diff --git a/PlayFabSDK/source/PlayFabAddonAPI.cs b/PlayFabSDK/source/PlayFabAddonAPI.cs
new file mode 100644
index 00000000..22960986
--- /dev/null
+++ b/PlayFabSDK/source/PlayFabAddonAPI.cs
@@ -0,0 +1,767 @@
+#if !DISABLE_PLAYFABENTITY_API && !DISABLE_PLAYFAB_STATIC_API
+
+using PlayFab.AddonModels;
+using PlayFab.Internal;
+#pragma warning disable 0649
+using System;
+// This is required for the Obsolete Attribute flag
+// which is not always present in all API's
+#pragma warning restore 0649
+using System.Collections.Generic;
+using System.Threading.Tasks;
+
+namespace PlayFab
+{
+ ///
+ /// APIs for managing addons.
+ ///
+ public static class PlayFabAddonAPI
+ {
+ ///
+ /// Verify entity login.
+ ///
+ public static bool IsEntityLoggedIn()
+ {
+ return PlayFabSettings.staticPlayer.IsEntityLoggedIn();
+ }
+
+ ///
+ /// Clear the Client SessionToken which allows this Client to call API calls requiring login.
+ /// A new/fresh login will be required after calling this.
+ ///
+ public static void ForgetAllCredentials()
+ {
+ PlayFabSettings.staticPlayer.ForgetAllCredentials();
+ }
+
+ ///
+ /// Creates the Apple addon on a title, or updates it if it already exists.
+ ///
+ public static async Task> CreateOrUpdateAppleAsync(CreateOrUpdateAppleRequest request, object customData = null, Dictionary extraHeaders = null)
+ {
+ await new PlayFabUtil.SynchronizationContextRemover();
+
+ var requestContext = request?.AuthenticationContext ?? PlayFabSettings.staticPlayer;
+ var requestSettings = PlayFabSettings.staticSettings;
+ if (requestContext.EntityToken == null) throw new PlayFabException(PlayFabExceptionCode.EntityTokenNotSet, "Must call Client Login or GetEntityToken before calling this method");
+
+
+ var httpResult = await PlayFabHttp.DoPost("/Addon/CreateOrUpdateApple", request, "X-EntityToken", requestContext.EntityToken, extraHeaders);
+ if (httpResult is PlayFabError)
+ {
+ var error = (PlayFabError)httpResult;
+ PlayFabSettings.GlobalErrorHandler?.Invoke(error);
+ return new PlayFabResult { Error = error, CustomData = customData };
+ }
+
+ var resultRawJson = (string)httpResult;
+ var resultData = PluginManager.GetPlugin(PluginContract.PlayFab_Serializer).DeserializeObject>(resultRawJson);
+ var result = resultData.data;
+
+ return new PlayFabResult { Result = result, CustomData = customData };
+ }
+
+ ///
+ /// Creates the Facebook addon on a title, or updates it if it already exists.
+ ///
+ public static async Task> CreateOrUpdateFacebookAsync(CreateOrUpdateFacebookRequest request, object customData = null, Dictionary extraHeaders = null)
+ {
+ await new PlayFabUtil.SynchronizationContextRemover();
+
+ var requestContext = request?.AuthenticationContext ?? PlayFabSettings.staticPlayer;
+ var requestSettings = PlayFabSettings.staticSettings;
+ if (requestContext.EntityToken == null) throw new PlayFabException(PlayFabExceptionCode.EntityTokenNotSet, "Must call Client Login or GetEntityToken before calling this method");
+
+
+ var httpResult = await PlayFabHttp.DoPost("/Addon/CreateOrUpdateFacebook", request, "X-EntityToken", requestContext.EntityToken, extraHeaders);
+ if (httpResult is PlayFabError)
+ {
+ var error = (PlayFabError)httpResult;
+ PlayFabSettings.GlobalErrorHandler?.Invoke(error);
+ return new PlayFabResult { Error = error, CustomData = customData };
+ }
+
+ var resultRawJson = (string)httpResult;
+ var resultData = PluginManager.GetPlugin(PluginContract.PlayFab_Serializer).DeserializeObject>(resultRawJson);
+ var result = resultData.data;
+
+ return new PlayFabResult { Result = result, CustomData = customData };
+ }
+
+ ///
+ /// Creates the Facebook Instant Games addon on a title, or updates it if it already exists.
+ ///
+ public static async Task> CreateOrUpdateFacebookInstantGamesAsync(CreateOrUpdateFacebookInstantGamesRequest request, object customData = null, Dictionary extraHeaders = null)
+ {
+ await new PlayFabUtil.SynchronizationContextRemover();
+
+ var requestContext = request?.AuthenticationContext ?? PlayFabSettings.staticPlayer;
+ var requestSettings = PlayFabSettings.staticSettings;
+ if (requestContext.EntityToken == null) throw new PlayFabException(PlayFabExceptionCode.EntityTokenNotSet, "Must call Client Login or GetEntityToken before calling this method");
+
+
+ var httpResult = await PlayFabHttp.DoPost("/Addon/CreateOrUpdateFacebookInstantGames", request, "X-EntityToken", requestContext.EntityToken, extraHeaders);
+ if (httpResult is PlayFabError)
+ {
+ var error = (PlayFabError)httpResult;
+ PlayFabSettings.GlobalErrorHandler?.Invoke(error);
+ return new PlayFabResult { Error = error, CustomData = customData };
+ }
+
+ var resultRawJson = (string)httpResult;
+ var resultData = PluginManager.GetPlugin(PluginContract.PlayFab_Serializer).DeserializeObject>(resultRawJson);
+ var result = resultData.data;
+
+ return new PlayFabResult { Result = result, CustomData = customData };
+ }
+
+ ///
+ /// Creates the Google addon on a title, or updates it if it already exists.
+ ///
+ public static async Task> CreateOrUpdateGoogleAsync(CreateOrUpdateGoogleRequest request, object customData = null, Dictionary extraHeaders = null)
+ {
+ await new PlayFabUtil.SynchronizationContextRemover();
+
+ var requestContext = request?.AuthenticationContext ?? PlayFabSettings.staticPlayer;
+ var requestSettings = PlayFabSettings.staticSettings;
+ if (requestContext.EntityToken == null) throw new PlayFabException(PlayFabExceptionCode.EntityTokenNotSet, "Must call Client Login or GetEntityToken before calling this method");
+
+
+ var httpResult = await PlayFabHttp.DoPost("/Addon/CreateOrUpdateGoogle", request, "X-EntityToken", requestContext.EntityToken, extraHeaders);
+ if (httpResult is PlayFabError)
+ {
+ var error = (PlayFabError)httpResult;
+ PlayFabSettings.GlobalErrorHandler?.Invoke(error);
+ return new PlayFabResult { Error = error, CustomData = customData };
+ }
+
+ var resultRawJson = (string)httpResult;
+ var resultData = PluginManager.GetPlugin(PluginContract.PlayFab_Serializer).DeserializeObject>(resultRawJson);
+ var result = resultData.data;
+
+ return new PlayFabResult { Result = result, CustomData = customData };
+ }
+
+ ///
+ /// Creates the Kongregate addon on a title, or updates it if it already exists.
+ ///
+ public static async Task> CreateOrUpdateKongregateAsync(CreateOrUpdateKongregateRequest request, object customData = null, Dictionary extraHeaders = null)
+ {
+ await new PlayFabUtil.SynchronizationContextRemover();
+
+ var requestContext = request?.AuthenticationContext ?? PlayFabSettings.staticPlayer;
+ var requestSettings = PlayFabSettings.staticSettings;
+ if (requestContext.EntityToken == null) throw new PlayFabException(PlayFabExceptionCode.EntityTokenNotSet, "Must call Client Login or GetEntityToken before calling this method");
+
+
+ var httpResult = await PlayFabHttp.DoPost("/Addon/CreateOrUpdateKongregate", request, "X-EntityToken", requestContext.EntityToken, extraHeaders);
+ if (httpResult is PlayFabError)
+ {
+ var error = (PlayFabError)httpResult;
+ PlayFabSettings.GlobalErrorHandler?.Invoke(error);
+ return new PlayFabResult { Error = error, CustomData = customData };
+ }
+
+ var resultRawJson = (string)httpResult;
+ var resultData = PluginManager.GetPlugin(PluginContract.PlayFab_Serializer).DeserializeObject>(resultRawJson);
+ var result = resultData.data;
+
+ return new PlayFabResult { Result = result, CustomData = customData };
+ }
+
+ ///
+ /// Creates the Nintendo addon on a title, or updates it if it already exists.
+ ///
+ public static async Task> CreateOrUpdateNintendoAsync(CreateOrUpdateNintendoRequest request, object customData = null, Dictionary extraHeaders = null)
+ {
+ await new PlayFabUtil.SynchronizationContextRemover();
+
+ var requestContext = request?.AuthenticationContext ?? PlayFabSettings.staticPlayer;
+ var requestSettings = PlayFabSettings.staticSettings;
+ if (requestContext.EntityToken == null) throw new PlayFabException(PlayFabExceptionCode.EntityTokenNotSet, "Must call Client Login or GetEntityToken before calling this method");
+
+
+ var httpResult = await PlayFabHttp.DoPost("/Addon/CreateOrUpdateNintendo", request, "X-EntityToken", requestContext.EntityToken, extraHeaders);
+ if (httpResult is PlayFabError)
+ {
+ var error = (PlayFabError)httpResult;
+ PlayFabSettings.GlobalErrorHandler?.Invoke(error);
+ return new PlayFabResult { Error = error, CustomData = customData };
+ }
+
+ var resultRawJson = (string)httpResult;
+ var resultData = PluginManager.GetPlugin(PluginContract.PlayFab_Serializer).DeserializeObject>(resultRawJson);
+ var result = resultData.data;
+
+ return new PlayFabResult { Result = result, CustomData = customData };
+ }
+
+ ///
+ /// Creates the PSN addon on a title, or updates it if it already exists.
+ ///
+ public static async Task> CreateOrUpdatePSNAsync(CreateOrUpdatePSNRequest request, object customData = null, Dictionary extraHeaders = null)
+ {
+ await new PlayFabUtil.SynchronizationContextRemover();
+
+ var requestContext = request?.AuthenticationContext ?? PlayFabSettings.staticPlayer;
+ var requestSettings = PlayFabSettings.staticSettings;
+ if (requestContext.EntityToken == null) throw new PlayFabException(PlayFabExceptionCode.EntityTokenNotSet, "Must call Client Login or GetEntityToken before calling this method");
+
+
+ var httpResult = await PlayFabHttp.DoPost("/Addon/CreateOrUpdatePSN", request, "X-EntityToken", requestContext.EntityToken, extraHeaders);
+ if (httpResult is PlayFabError)
+ {
+ var error = (PlayFabError)httpResult;
+ PlayFabSettings.GlobalErrorHandler?.Invoke(error);
+ return new PlayFabResult { Error = error, CustomData = customData };
+ }
+
+ var resultRawJson = (string)httpResult;
+ var resultData = PluginManager.GetPlugin(PluginContract.PlayFab_Serializer).DeserializeObject>(resultRawJson);
+ var result = resultData.data;
+
+ return new PlayFabResult { Result = result, CustomData = customData };
+ }
+
+ ///
+ /// Creates the Steam addon on a title, or updates it if it already exists.
+ ///
+ public static async Task> CreateOrUpdateSteamAsync(CreateOrUpdateSteamRequest request, object customData = null, Dictionary extraHeaders = null)
+ {
+ await new PlayFabUtil.SynchronizationContextRemover();
+
+ var requestContext = request?.AuthenticationContext ?? PlayFabSettings.staticPlayer;
+ var requestSettings = PlayFabSettings.staticSettings;
+ if (requestContext.EntityToken == null) throw new PlayFabException(PlayFabExceptionCode.EntityTokenNotSet, "Must call Client Login or GetEntityToken before calling this method");
+
+
+ var httpResult = await PlayFabHttp.DoPost("/Addon/CreateOrUpdateSteam", request, "X-EntityToken", requestContext.EntityToken, extraHeaders);
+ if (httpResult is PlayFabError)
+ {
+ var error = (PlayFabError)httpResult;
+ PlayFabSettings.GlobalErrorHandler?.Invoke(error);
+ return new PlayFabResult { Error = error, CustomData = customData };
+ }
+
+ var resultRawJson = (string)httpResult;
+ var resultData = PluginManager.GetPlugin(PluginContract.PlayFab_Serializer).DeserializeObject>(resultRawJson);
+ var result = resultData.data;
+
+ return new PlayFabResult { Result = result, CustomData = customData };
+ }
+
+ ///
+ /// Creates the Twitch addon on a title, or updates it if it already exists.
+ ///
+ public static async Task> CreateOrUpdateTwitchAsync(CreateOrUpdateTwitchRequest request, object customData = null, Dictionary extraHeaders = null)
+ {
+ await new PlayFabUtil.SynchronizationContextRemover();
+
+ var requestContext = request?.AuthenticationContext ?? PlayFabSettings.staticPlayer;
+ var requestSettings = PlayFabSettings.staticSettings;
+ if (requestContext.EntityToken == null) throw new PlayFabException(PlayFabExceptionCode.EntityTokenNotSet, "Must call Client Login or GetEntityToken before calling this method");
+
+
+ var httpResult = await PlayFabHttp.DoPost("/Addon/CreateOrUpdateTwitch", request, "X-EntityToken", requestContext.EntityToken, extraHeaders);
+ if (httpResult is PlayFabError)
+ {
+ var error = (PlayFabError)httpResult;
+ PlayFabSettings.GlobalErrorHandler?.Invoke(error);
+ return new PlayFabResult { Error = error, CustomData = customData };
+ }
+
+ var resultRawJson = (string)httpResult;
+ var resultData = PluginManager.GetPlugin(PluginContract.PlayFab_Serializer).DeserializeObject>(resultRawJson);
+ var result = resultData.data;
+
+ return new PlayFabResult { Result = result, CustomData = customData };
+ }
+
+ ///
+ /// Deletes the Apple addon on a title.
+ ///
+ public static async Task> DeleteAppleAsync(DeleteAppleRequest request, object customData = null, Dictionary extraHeaders = null)
+ {
+ await new PlayFabUtil.SynchronizationContextRemover();
+
+ var requestContext = request?.AuthenticationContext ?? PlayFabSettings.staticPlayer;
+ var requestSettings = PlayFabSettings.staticSettings;
+ if (requestContext.EntityToken == null) throw new PlayFabException(PlayFabExceptionCode.EntityTokenNotSet, "Must call Client Login or GetEntityToken before calling this method");
+
+
+ var httpResult = await PlayFabHttp.DoPost("/Addon/DeleteApple", request, "X-EntityToken", requestContext.EntityToken, extraHeaders);
+ if (httpResult is PlayFabError)
+ {
+ var error = (PlayFabError)httpResult;
+ PlayFabSettings.GlobalErrorHandler?.Invoke(error);
+ return new PlayFabResult { Error = error, CustomData = customData };
+ }
+
+ var resultRawJson = (string)httpResult;
+ var resultData = PluginManager.GetPlugin(PluginContract.PlayFab_Serializer).DeserializeObject>(resultRawJson);
+ var result = resultData.data;
+
+ return new PlayFabResult { Result = result, CustomData = customData };
+ }
+
+ ///
+ /// Deletes the Facebook addon on a title.
+ ///
+ public static async Task> DeleteFacebookAsync(DeleteFacebookRequest request, object customData = null, Dictionary extraHeaders = null)
+ {
+ await new PlayFabUtil.SynchronizationContextRemover();
+
+ var requestContext = request?.AuthenticationContext ?? PlayFabSettings.staticPlayer;
+ var requestSettings = PlayFabSettings.staticSettings;
+ if (requestContext.EntityToken == null) throw new PlayFabException(PlayFabExceptionCode.EntityTokenNotSet, "Must call Client Login or GetEntityToken before calling this method");
+
+
+ var httpResult = await PlayFabHttp.DoPost("/Addon/DeleteFacebook", request, "X-EntityToken", requestContext.EntityToken, extraHeaders);
+ if (httpResult is PlayFabError)
+ {
+ var error = (PlayFabError)httpResult;
+ PlayFabSettings.GlobalErrorHandler?.Invoke(error);
+ return new PlayFabResult { Error = error, CustomData = customData };
+ }
+
+ var resultRawJson = (string)httpResult;
+ var resultData = PluginManager.GetPlugin(PluginContract.PlayFab_Serializer).DeserializeObject>(resultRawJson);
+ var result = resultData.data;
+
+ return new PlayFabResult { Result = result, CustomData = customData };
+ }
+
+ ///
+ /// Deletes the Facebook addon on a title.
+ ///
+ public static async Task> DeleteFacebookInstantGamesAsync(DeleteFacebookInstantGamesRequest request, object customData = null, Dictionary extraHeaders = null)
+ {
+ await new PlayFabUtil.SynchronizationContextRemover();
+
+ var requestContext = request?.AuthenticationContext ?? PlayFabSettings.staticPlayer;
+ var requestSettings = PlayFabSettings.staticSettings;
+ if (requestContext.EntityToken == null) throw new PlayFabException(PlayFabExceptionCode.EntityTokenNotSet, "Must call Client Login or GetEntityToken before calling this method");
+
+
+ var httpResult = await PlayFabHttp.DoPost("/Addon/DeleteFacebookInstantGames", request, "X-EntityToken", requestContext.EntityToken, extraHeaders);
+ if (httpResult is PlayFabError)
+ {
+ var error = (PlayFabError)httpResult;
+ PlayFabSettings.GlobalErrorHandler?.Invoke(error);
+ return new PlayFabResult { Error = error, CustomData = customData };
+ }
+
+ var resultRawJson = (string)httpResult;
+ var resultData = PluginManager.GetPlugin(PluginContract.PlayFab_Serializer).DeserializeObject>(resultRawJson);
+ var result = resultData.data;
+
+ return new PlayFabResult { Result = result, CustomData = customData };
+ }
+
+ ///
+ /// Deletes the Google addon on a title.
+ ///
+ public static async Task> DeleteGoogleAsync(DeleteGoogleRequest request, object customData = null, Dictionary extraHeaders = null)
+ {
+ await new PlayFabUtil.SynchronizationContextRemover();
+
+ var requestContext = request?.AuthenticationContext ?? PlayFabSettings.staticPlayer;
+ var requestSettings = PlayFabSettings.staticSettings;
+ if (requestContext.EntityToken == null) throw new PlayFabException(PlayFabExceptionCode.EntityTokenNotSet, "Must call Client Login or GetEntityToken before calling this method");
+
+
+ var httpResult = await PlayFabHttp.DoPost("/Addon/DeleteGoogle", request, "X-EntityToken", requestContext.EntityToken, extraHeaders);
+ if (httpResult is PlayFabError)
+ {
+ var error = (PlayFabError)httpResult;
+ PlayFabSettings.GlobalErrorHandler?.Invoke(error);
+ return new PlayFabResult { Error = error, CustomData = customData };
+ }
+
+ var resultRawJson = (string)httpResult;
+ var resultData = PluginManager.GetPlugin(PluginContract.PlayFab_Serializer).DeserializeObject>(resultRawJson);
+ var result = resultData.data;
+
+ return new PlayFabResult { Result = result, CustomData = customData };
+ }
+
+ ///
+ /// Deletes the Kongregate addon on a title.
+ ///
+ public static async Task> DeleteKongregateAsync(DeleteKongregateRequest request, object customData = null, Dictionary extraHeaders = null)
+ {
+ await new PlayFabUtil.SynchronizationContextRemover();
+
+ var requestContext = request?.AuthenticationContext ?? PlayFabSettings.staticPlayer;
+ var requestSettings = PlayFabSettings.staticSettings;
+ if (requestContext.EntityToken == null) throw new PlayFabException(PlayFabExceptionCode.EntityTokenNotSet, "Must call Client Login or GetEntityToken before calling this method");
+
+
+ var httpResult = await PlayFabHttp.DoPost("/Addon/DeleteKongregate", request, "X-EntityToken", requestContext.EntityToken, extraHeaders);
+ if (httpResult is PlayFabError)
+ {
+ var error = (PlayFabError)httpResult;
+ PlayFabSettings.GlobalErrorHandler?.Invoke(error);
+ return new PlayFabResult { Error = error, CustomData = customData };
+ }
+
+ var resultRawJson = (string)httpResult;
+ var resultData = PluginManager.GetPlugin(PluginContract.PlayFab_Serializer).DeserializeObject>(resultRawJson);
+ var result = resultData.data;
+
+ return new PlayFabResult { Result = result, CustomData = customData };
+ }
+
+ ///
+ /// Deletes the Nintendo addon on a title.
+ ///
+ public static async Task> DeleteNintendoAsync(DeleteNintendoRequest request, object customData = null, Dictionary extraHeaders = null)
+ {
+ await new PlayFabUtil.SynchronizationContextRemover();
+
+ var requestContext = request?.AuthenticationContext ?? PlayFabSettings.staticPlayer;
+ var requestSettings = PlayFabSettings.staticSettings;
+ if (requestContext.EntityToken == null) throw new PlayFabException(PlayFabExceptionCode.EntityTokenNotSet, "Must call Client Login or GetEntityToken before calling this method");
+
+
+ var httpResult = await PlayFabHttp.DoPost("/Addon/DeleteNintendo", request, "X-EntityToken", requestContext.EntityToken, extraHeaders);
+ if (httpResult is PlayFabError)
+ {
+ var error = (PlayFabError)httpResult;
+ PlayFabSettings.GlobalErrorHandler?.Invoke(error);
+ return new PlayFabResult { Error = error, CustomData = customData };
+ }
+
+ var resultRawJson = (string)httpResult;
+ var resultData = PluginManager.GetPlugin(PluginContract.PlayFab_Serializer).DeserializeObject>(resultRawJson);
+ var result = resultData.data;
+
+ return new PlayFabResult { Result = result, CustomData = customData };
+ }
+
+ ///
+ /// Deletes the PSN addon on a title.
+ ///
+ public static async Task> DeletePSNAsync(DeletePSNRequest request, object customData = null, Dictionary extraHeaders = null)
+ {
+ await new PlayFabUtil.SynchronizationContextRemover();
+
+ var requestContext = request?.AuthenticationContext ?? PlayFabSettings.staticPlayer;
+ var requestSettings = PlayFabSettings.staticSettings;
+ if (requestContext.EntityToken == null) throw new PlayFabException(PlayFabExceptionCode.EntityTokenNotSet, "Must call Client Login or GetEntityToken before calling this method");
+
+
+ var httpResult = await PlayFabHttp.DoPost("/Addon/DeletePSN", request, "X-EntityToken", requestContext.EntityToken, extraHeaders);
+ if (httpResult is PlayFabError)
+ {
+ var error = (PlayFabError)httpResult;
+ PlayFabSettings.GlobalErrorHandler?.Invoke(error);
+ return new PlayFabResult { Error = error, CustomData = customData };
+ }
+
+ var resultRawJson = (string)httpResult;
+ var resultData = PluginManager.GetPlugin(PluginContract.PlayFab_Serializer).DeserializeObject>(resultRawJson);
+ var result = resultData.data;
+
+ return new PlayFabResult { Result = result, CustomData = customData };
+ }
+
+ ///
+ /// Deletes the Steam addon on a title.
+ ///
+ public static async Task> DeleteSteamAsync(DeleteSteamRequest request, object customData = null, Dictionary extraHeaders = null)
+ {
+ await new PlayFabUtil.SynchronizationContextRemover();
+
+ var requestContext = request?.AuthenticationContext ?? PlayFabSettings.staticPlayer;
+ var requestSettings = PlayFabSettings.staticSettings;
+ if (requestContext.EntityToken == null) throw new PlayFabException(PlayFabExceptionCode.EntityTokenNotSet, "Must call Client Login or GetEntityToken before calling this method");
+
+
+ var httpResult = await PlayFabHttp.DoPost("/Addon/DeleteSteam", request, "X-EntityToken", requestContext.EntityToken, extraHeaders);
+ if (httpResult is PlayFabError)
+ {
+ var error = (PlayFabError)httpResult;
+ PlayFabSettings.GlobalErrorHandler?.Invoke(error);
+ return new PlayFabResult { Error = error, CustomData = customData };
+ }
+
+ var resultRawJson = (string)httpResult;
+ var resultData = PluginManager.GetPlugin(PluginContract.PlayFab_Serializer).DeserializeObject>(resultRawJson);
+ var result = resultData.data;
+
+ return new PlayFabResult { Result = result, CustomData = customData };
+ }
+
+ ///
+ /// Deletes the Twitch addon on a title.
+ ///
+ public static async Task> DeleteTwitchAsync(DeleteTwitchRequest request, object customData = null, Dictionary extraHeaders = null)
+ {
+ await new PlayFabUtil.SynchronizationContextRemover();
+
+ var requestContext = request?.AuthenticationContext ?? PlayFabSettings.staticPlayer;
+ var requestSettings = PlayFabSettings.staticSettings;
+ if (requestContext.EntityToken == null) throw new PlayFabException(PlayFabExceptionCode.EntityTokenNotSet, "Must call Client Login or GetEntityToken before calling this method");
+
+
+ var httpResult = await PlayFabHttp.DoPost("/Addon/DeleteTwitch", request, "X-EntityToken", requestContext.EntityToken, extraHeaders);
+ if (httpResult is PlayFabError)
+ {
+ var error = (PlayFabError)httpResult;
+ PlayFabSettings.GlobalErrorHandler?.Invoke(error);
+ return new PlayFabResult { Error = error, CustomData = customData };
+ }
+
+ var resultRawJson = (string)httpResult;
+ var resultData = PluginManager.GetPlugin(PluginContract.PlayFab_Serializer).DeserializeObject>(resultRawJson);
+ var result = resultData.data;
+
+ return new PlayFabResult { Result = result, CustomData = customData };
+ }
+
+ ///
+ /// Gets information of the Apple addon on a title, omits secrets.
+ ///
+ public static async Task> GetAppleAsync(GetAppleRequest request, object customData = null, Dictionary extraHeaders = null)
+ {
+ await new PlayFabUtil.SynchronizationContextRemover();
+
+ var requestContext = request?.AuthenticationContext ?? PlayFabSettings.staticPlayer;
+ var requestSettings = PlayFabSettings.staticSettings;
+ if (requestContext.EntityToken == null) throw new PlayFabException(PlayFabExceptionCode.EntityTokenNotSet, "Must call Client Login or GetEntityToken before calling this method");
+
+
+ var httpResult = await PlayFabHttp.DoPost("/Addon/GetApple", request, "X-EntityToken", requestContext.EntityToken, extraHeaders);
+ if (httpResult is PlayFabError)
+ {
+ var error = (PlayFabError)httpResult;
+ PlayFabSettings.GlobalErrorHandler?.Invoke(error);
+ return new PlayFabResult { Error = error, CustomData = customData };
+ }
+
+ var resultRawJson = (string)httpResult;
+ var resultData = PluginManager.GetPlugin(PluginContract.PlayFab_Serializer).DeserializeObject>(resultRawJson);
+ var result = resultData.data;
+
+ return new PlayFabResult { Result = result, CustomData = customData };
+ }
+
+ ///
+ /// Gets information of the Facebook addon on a title, omits secrets.
+ ///
+ public static async Task> GetFacebookAsync(GetFacebookRequest request, object customData = null, Dictionary extraHeaders = null)
+ {
+ await new PlayFabUtil.SynchronizationContextRemover();
+
+ var requestContext = request?.AuthenticationContext ?? PlayFabSettings.staticPlayer;
+ var requestSettings = PlayFabSettings.staticSettings;
+ if (requestContext.EntityToken == null) throw new PlayFabException(PlayFabExceptionCode.EntityTokenNotSet, "Must call Client Login or GetEntityToken before calling this method");
+
+
+ var httpResult = await PlayFabHttp.DoPost("/Addon/GetFacebook", request, "X-EntityToken", requestContext.EntityToken, extraHeaders);
+ if (httpResult is PlayFabError)
+ {
+ var error = (PlayFabError)httpResult;
+ PlayFabSettings.GlobalErrorHandler?.Invoke(error);
+ return new PlayFabResult { Error = error, CustomData = customData };
+ }
+
+ var resultRawJson = (string)httpResult;
+ var resultData = PluginManager.GetPlugin(PluginContract.PlayFab_Serializer).DeserializeObject>(resultRawJson);
+ var result = resultData.data;
+
+ return new PlayFabResult { Result = result, CustomData = customData };
+ }
+
+ ///
+ /// Gets information of the Facebook Instant Games addon on a title, omits secrets.
+ ///
+ public static async Task> GetFacebookInstantGamesAsync(GetFacebookInstantGamesRequest request, object customData = null, Dictionary extraHeaders = null)
+ {
+ await new PlayFabUtil.SynchronizationContextRemover();
+
+ var requestContext = request?.AuthenticationContext ?? PlayFabSettings.staticPlayer;
+ var requestSettings = PlayFabSettings.staticSettings;
+ if (requestContext.EntityToken == null) throw new PlayFabException(PlayFabExceptionCode.EntityTokenNotSet, "Must call Client Login or GetEntityToken before calling this method");
+
+
+ var httpResult = await PlayFabHttp.DoPost("/Addon/GetFacebookInstantGames", request, "X-EntityToken", requestContext.EntityToken, extraHeaders);
+ if (httpResult is PlayFabError)
+ {
+ var error = (PlayFabError)httpResult;
+ PlayFabSettings.GlobalErrorHandler?.Invoke(error);
+ return new PlayFabResult { Error = error, CustomData = customData };
+ }
+
+ var resultRawJson = (string)httpResult;
+ var resultData = PluginManager.GetPlugin(PluginContract.PlayFab_Serializer).DeserializeObject>(resultRawJson);
+ var result = resultData.data;
+
+ return new PlayFabResult { Result = result, CustomData = customData };
+ }
+
+ ///
+ /// Gets information of the Google addon on a title, omits secrets.
+ ///
+ public static async Task> GetGoogleAsync(GetGoogleRequest request, object customData = null, Dictionary extraHeaders = null)
+ {
+ await new PlayFabUtil.SynchronizationContextRemover();
+
+ var requestContext = request?.AuthenticationContext ?? PlayFabSettings.staticPlayer;
+ var requestSettings = PlayFabSettings.staticSettings;
+ if (requestContext.EntityToken == null) throw new PlayFabException(PlayFabExceptionCode.EntityTokenNotSet, "Must call Client Login or GetEntityToken before calling this method");
+
+
+ var httpResult = await PlayFabHttp.DoPost("/Addon/GetGoogle", request, "X-EntityToken", requestContext.EntityToken, extraHeaders);
+ if (httpResult is PlayFabError)
+ {
+ var error = (PlayFabError)httpResult;
+ PlayFabSettings.GlobalErrorHandler?.Invoke(error);
+ return new PlayFabResult { Error = error, CustomData = customData };
+ }
+
+ var resultRawJson = (string)httpResult;
+ var resultData = PluginManager.GetPlugin(PluginContract.PlayFab_Serializer).DeserializeObject>(resultRawJson);
+ var result = resultData.data;
+
+ return new PlayFabResult { Result = result, CustomData = customData };
+ }
+
+ ///
+ /// Gets information of the Kongregate addon on a title, omits secrets.
+ ///
+ public static async Task> GetKongregateAsync(GetKongregateRequest request, object customData = null, Dictionary extraHeaders = null)
+ {
+ await new PlayFabUtil.SynchronizationContextRemover();
+
+ var requestContext = request?.AuthenticationContext ?? PlayFabSettings.staticPlayer;
+ var requestSettings = PlayFabSettings.staticSettings;
+ if (requestContext.EntityToken == null) throw new PlayFabException(PlayFabExceptionCode.EntityTokenNotSet, "Must call Client Login or GetEntityToken before calling this method");
+
+
+ var httpResult = await PlayFabHttp.DoPost("/Addon/GetKongregate", request, "X-EntityToken", requestContext.EntityToken, extraHeaders);
+ if (httpResult is PlayFabError)
+ {
+ var error = (PlayFabError)httpResult;
+ PlayFabSettings.GlobalErrorHandler?.Invoke(error);
+ return new PlayFabResult { Error = error, CustomData = customData };
+ }
+
+ var resultRawJson = (string)httpResult;
+ var resultData = PluginManager.GetPlugin(PluginContract.PlayFab_Serializer).DeserializeObject>(resultRawJson);
+ var result = resultData.data;
+
+ return new PlayFabResult { Result = result, CustomData = customData };
+ }
+
+ ///
+ /// Gets information of the Nintendo addon on a title, omits secrets.
+ ///
+ public static async Task> GetNintendoAsync(GetNintendoRequest request, object customData = null, Dictionary extraHeaders = null)
+ {
+ await new PlayFabUtil.SynchronizationContextRemover();
+
+ var requestContext = request?.AuthenticationContext ?? PlayFabSettings.staticPlayer;
+ var requestSettings = PlayFabSettings.staticSettings;
+ if (requestContext.EntityToken == null) throw new PlayFabException(PlayFabExceptionCode.EntityTokenNotSet, "Must call Client Login or GetEntityToken before calling this method");
+
+
+ var httpResult = await PlayFabHttp.DoPost("/Addon/GetNintendo", request, "X-EntityToken", requestContext.EntityToken, extraHeaders);
+ if (httpResult is PlayFabError)
+ {
+ var error = (PlayFabError)httpResult;
+ PlayFabSettings.GlobalErrorHandler?.Invoke(error);
+ return new PlayFabResult { Error = error, CustomData = customData };
+ }
+
+ var resultRawJson = (string)httpResult;
+ var resultData = PluginManager.GetPlugin(PluginContract.PlayFab_Serializer).DeserializeObject>(resultRawJson);
+ var result = resultData.data;
+
+ return new PlayFabResult { Result = result, CustomData = customData };
+ }
+
+ ///
+ /// Gets information of the PSN addon on a title, omits secrets.
+ ///
+ public static async Task> GetPSNAsync(GetPSNRequest request, object customData = null, Dictionary extraHeaders = null)
+ {
+ await new PlayFabUtil.SynchronizationContextRemover();
+
+ var requestContext = request?.AuthenticationContext ?? PlayFabSettings.staticPlayer;
+ var requestSettings = PlayFabSettings.staticSettings;
+ if (requestContext.EntityToken == null) throw new PlayFabException(PlayFabExceptionCode.EntityTokenNotSet, "Must call Client Login or GetEntityToken before calling this method");
+
+
+ var httpResult = await PlayFabHttp.DoPost("/Addon/GetPSN", request, "X-EntityToken", requestContext.EntityToken, extraHeaders);
+ if (httpResult is PlayFabError)
+ {
+ var error = (PlayFabError)httpResult;
+ PlayFabSettings.GlobalErrorHandler?.Invoke(error);
+ return new PlayFabResult { Error = error, CustomData = customData };
+ }
+
+ var resultRawJson = (string)httpResult;
+ var resultData = PluginManager.GetPlugin(PluginContract.PlayFab_Serializer).DeserializeObject>(resultRawJson);
+ var result = resultData.data;
+
+ return new PlayFabResult { Result = result, CustomData = customData };
+ }
+
+ ///
+ /// Gets information of the Steam addon on a title, omits secrets.
+ ///
+ public static async Task> GetSteamAsync(GetSteamRequest request, object customData = null, Dictionary extraHeaders = null)
+ {
+ await new PlayFabUtil.SynchronizationContextRemover();
+
+ var requestContext = request?.AuthenticationContext ?? PlayFabSettings.staticPlayer;
+ var requestSettings = PlayFabSettings.staticSettings;
+ if (requestContext.EntityToken == null) throw new PlayFabException(PlayFabExceptionCode.EntityTokenNotSet, "Must call Client Login or GetEntityToken before calling this method");
+
+
+ var httpResult = await PlayFabHttp.DoPost("/Addon/GetSteam", request, "X-EntityToken", requestContext.EntityToken, extraHeaders);
+ if (httpResult is PlayFabError)
+ {
+ var error = (PlayFabError)httpResult;
+ PlayFabSettings.GlobalErrorHandler?.Invoke(error);
+ return new PlayFabResult { Error = error, CustomData = customData };
+ }
+
+ var resultRawJson = (string)httpResult;
+ var resultData = PluginManager.GetPlugin(PluginContract.PlayFab_Serializer).DeserializeObject>(resultRawJson);
+ var result = resultData.data;
+
+ return new PlayFabResult { Result = result, CustomData = customData };
+ }
+
+ ///
+ /// Gets information of the Twitch addon on a title, omits secrets.
+ ///
+ public static async Task> GetTwitchAsync(GetTwitchRequest request, object customData = null, Dictionary extraHeaders = null)
+ {
+ await new PlayFabUtil.SynchronizationContextRemover();
+
+ var requestContext = request?.AuthenticationContext ?? PlayFabSettings.staticPlayer;
+ var requestSettings = PlayFabSettings.staticSettings;
+ if (requestContext.EntityToken == null) throw new PlayFabException(PlayFabExceptionCode.EntityTokenNotSet, "Must call Client Login or GetEntityToken before calling this method");
+
+
+ var httpResult = await PlayFabHttp.DoPost("/Addon/GetTwitch", request, "X-EntityToken", requestContext.EntityToken, extraHeaders);
+ if (httpResult is PlayFabError)
+ {
+ var error = (PlayFabError)httpResult;
+ PlayFabSettings.GlobalErrorHandler?.Invoke(error);
+ return new PlayFabResult { Error = error, CustomData = customData };
+ }
+
+ var resultRawJson = (string)httpResult;
+ var resultData = PluginManager.GetPlugin(PluginContract.PlayFab_Serializer).DeserializeObject>(resultRawJson);
+ var result = resultData.data;
+
+ return new PlayFabResult { Result = result, CustomData = customData };
+ }
+}
+}
+#endif
diff --git a/PlayFabSDK/source/PlayFabAddonInstanceAPI.cs b/PlayFabSDK/source/PlayFabAddonInstanceAPI.cs
new file mode 100644
index 00000000..2da234ba
--- /dev/null
+++ b/PlayFabSDK/source/PlayFabAddonInstanceAPI.cs
@@ -0,0 +1,759 @@
+#if !DISABLE_PLAYFABENTITY_API
+
+using PlayFab.AddonModels;
+using PlayFab.Internal;
+#pragma warning disable 0649
+using System;
+// This is required for the Obsolete Attribute flag
+// which is not always present in all API's
+#pragma warning restore 0649
+using System.Collections.Generic;
+using System.Threading.Tasks;
+
+namespace PlayFab
+{
+ ///
+ /// APIs for managing addons.
+ ///
+ public class PlayFabAddonInstanceAPI
+ {
+ public readonly PlayFabApiSettings apiSettings = null;
+ public readonly PlayFabAuthenticationContext authenticationContext = null;
+
+ public PlayFabAddonInstanceAPI(PlayFabAuthenticationContext context)
+ {
+ if (context == null)
+ throw new PlayFabException(PlayFabExceptionCode.AuthContextRequired, "Context cannot be null, create a PlayFabAuthenticationContext for each player in advance, or get .authenticationContext");
+ authenticationContext = context;
+ }
+
+ public PlayFabAddonInstanceAPI(PlayFabApiSettings settings, PlayFabAuthenticationContext context)
+ {
+ if (context == null)
+ throw new PlayFabException(PlayFabExceptionCode.AuthContextRequired, "Context cannot be null, create a PlayFabAuthenticationContext for each player in advance, or get .authenticationContext");
+ apiSettings = settings;
+ authenticationContext = context;
+ }
+
+ ///
+ /// Verify entity login.
+ ///
+ public bool IsEntityLoggedIn()
+ {
+ return authenticationContext == null ? false : authenticationContext.IsEntityLoggedIn();
+ }
+
+ ///
+ /// Clear the Client SessionToken which allows this Client to call API calls requiring login.
+ /// A new/fresh login will be required after calling this.
+ ///
+ public void ForgetAllCredentials()
+ {
+ authenticationContext?.ForgetAllCredentials();
+ }
+
+ ///
+ /// Creates the Apple addon on a title, or updates it if it already exists.
+ ///
+ public async Task> CreateOrUpdateAppleAsync(CreateOrUpdateAppleRequest request, object customData = null, Dictionary extraHeaders = null)
+ {
+ await new PlayFabUtil.SynchronizationContextRemover();
+
+ var requestContext = request?.AuthenticationContext ?? authenticationContext;
+ var requestSettings = apiSettings ?? PlayFabSettings.staticSettings;
+ if (requestContext.EntityToken == null) throw new PlayFabException(PlayFabExceptionCode.EntityTokenNotSet, "Must call Client Login or GetEntityToken before calling this method");
+
+ var httpResult = await PlayFabHttp.DoPost("/Addon/CreateOrUpdateApple", request, "X-EntityToken", requestContext.EntityToken, extraHeaders, requestSettings);
+ if (httpResult is PlayFabError)
+ {
+ var error = (PlayFabError)httpResult;
+ PlayFabSettings.GlobalErrorHandler?.Invoke(error);
+ return new PlayFabResult { Error = error, CustomData = customData };
+ }
+
+ var resultRawJson = (string)httpResult;
+ var resultData = PluginManager.GetPlugin(PluginContract.PlayFab_Serializer).DeserializeObject>(resultRawJson);
+ var result = resultData.data;
+
+ return new PlayFabResult { Result = result, CustomData = customData };
+ }
+
+ ///
+ /// Creates the Facebook addon on a title, or updates it if it already exists.
+ ///
+ public async Task> CreateOrUpdateFacebookAsync(CreateOrUpdateFacebookRequest request, object customData = null, Dictionary extraHeaders = null)
+ {
+ await new PlayFabUtil.SynchronizationContextRemover();
+
+ var requestContext = request?.AuthenticationContext ?? authenticationContext;
+ var requestSettings = apiSettings ?? PlayFabSettings.staticSettings;
+ if (requestContext.EntityToken == null) throw new PlayFabException(PlayFabExceptionCode.EntityTokenNotSet, "Must call Client Login or GetEntityToken before calling this method");
+
+ var httpResult = await PlayFabHttp.DoPost("/Addon/CreateOrUpdateFacebook", request, "X-EntityToken", requestContext.EntityToken, extraHeaders, requestSettings);
+ if (httpResult is PlayFabError)
+ {
+ var error = (PlayFabError)httpResult;
+ PlayFabSettings.GlobalErrorHandler?.Invoke(error);
+ return new PlayFabResult { Error = error, CustomData = customData };
+ }
+
+ var resultRawJson = (string)httpResult;
+ var resultData = PluginManager.GetPlugin(PluginContract.PlayFab_Serializer).DeserializeObject>(resultRawJson);
+ var result = resultData.data;
+
+ return new PlayFabResult { Result = result, CustomData = customData };
+ }
+
+ ///
+ /// Creates the Facebook Instant Games addon on a title, or updates it if it already exists.
+ ///
+ public async Task> CreateOrUpdateFacebookInstantGamesAsync(CreateOrUpdateFacebookInstantGamesRequest request, object customData = null, Dictionary extraHeaders = null)
+ {
+ await new PlayFabUtil.SynchronizationContextRemover();
+
+ var requestContext = request?.AuthenticationContext ?? authenticationContext;
+ var requestSettings = apiSettings ?? PlayFabSettings.staticSettings;
+ if (requestContext.EntityToken == null) throw new PlayFabException(PlayFabExceptionCode.EntityTokenNotSet, "Must call Client Login or GetEntityToken before calling this method");
+
+ var httpResult = await PlayFabHttp.DoPost("/Addon/CreateOrUpdateFacebookInstantGames", request, "X-EntityToken", requestContext.EntityToken, extraHeaders, requestSettings);
+ if (httpResult is PlayFabError)
+ {
+ var error = (PlayFabError)httpResult;
+ PlayFabSettings.GlobalErrorHandler?.Invoke(error);
+ return new PlayFabResult { Error = error, CustomData = customData };
+ }
+
+ var resultRawJson = (string)httpResult;
+ var resultData = PluginManager.GetPlugin(PluginContract.PlayFab_Serializer).DeserializeObject>(resultRawJson);
+ var result = resultData.data;
+
+ return new PlayFabResult { Result = result, CustomData = customData };
+ }
+
+ ///
+ /// Creates the Google addon on a title, or updates it if it already exists.
+ ///
+ public async Task> CreateOrUpdateGoogleAsync(CreateOrUpdateGoogleRequest request, object customData = null, Dictionary extraHeaders = null)
+ {
+ await new PlayFabUtil.SynchronizationContextRemover();
+
+ var requestContext = request?.AuthenticationContext ?? authenticationContext;
+ var requestSettings = apiSettings ?? PlayFabSettings.staticSettings;
+ if (requestContext.EntityToken == null) throw new PlayFabException(PlayFabExceptionCode.EntityTokenNotSet, "Must call Client Login or GetEntityToken before calling this method");
+
+ var httpResult = await PlayFabHttp.DoPost("/Addon/CreateOrUpdateGoogle", request, "X-EntityToken", requestContext.EntityToken, extraHeaders, requestSettings);
+ if (httpResult is PlayFabError)
+ {
+ var error = (PlayFabError)httpResult;
+ PlayFabSettings.GlobalErrorHandler?.Invoke(error);
+ return new PlayFabResult { Error = error, CustomData = customData };
+ }
+
+ var resultRawJson = (string)httpResult;
+ var resultData = PluginManager.GetPlugin(PluginContract.PlayFab_Serializer).DeserializeObject>(resultRawJson);
+ var result = resultData.data;
+
+ return new PlayFabResult { Result = result, CustomData = customData };
+ }
+
+ ///
+ /// Creates the Kongregate addon on a title, or updates it if it already exists.
+ ///
+ public async Task> CreateOrUpdateKongregateAsync(CreateOrUpdateKongregateRequest request, object customData = null, Dictionary extraHeaders = null)
+ {
+ await new PlayFabUtil.SynchronizationContextRemover();
+
+ var requestContext = request?.AuthenticationContext ?? authenticationContext;
+ var requestSettings = apiSettings ?? PlayFabSettings.staticSettings;
+ if (requestContext.EntityToken == null) throw new PlayFabException(PlayFabExceptionCode.EntityTokenNotSet, "Must call Client Login or GetEntityToken before calling this method");
+
+ var httpResult = await PlayFabHttp.DoPost("/Addon/CreateOrUpdateKongregate", request, "X-EntityToken", requestContext.EntityToken, extraHeaders, requestSettings);
+ if (httpResult is PlayFabError)
+ {
+ var error = (PlayFabError)httpResult;
+ PlayFabSettings.GlobalErrorHandler?.Invoke(error);
+ return new PlayFabResult { Error = error, CustomData = customData };
+ }
+
+ var resultRawJson = (string)httpResult;
+ var resultData = PluginManager.GetPlugin(PluginContract.PlayFab_Serializer).DeserializeObject>(resultRawJson);
+ var result = resultData.data;
+
+ return new PlayFabResult { Result = result, CustomData = customData };
+ }
+
+ ///
+ /// Creates the Nintendo addon on a title, or updates it if it already exists.
+ ///
+ public async Task> CreateOrUpdateNintendoAsync(CreateOrUpdateNintendoRequest request, object customData = null, Dictionary extraHeaders = null)
+ {
+ await new PlayFabUtil.SynchronizationContextRemover();
+
+ var requestContext = request?.AuthenticationContext ?? authenticationContext;
+ var requestSettings = apiSettings ?? PlayFabSettings.staticSettings;
+ if (requestContext.EntityToken == null) throw new PlayFabException(PlayFabExceptionCode.EntityTokenNotSet, "Must call Client Login or GetEntityToken before calling this method");
+
+ var httpResult = await PlayFabHttp.DoPost("/Addon/CreateOrUpdateNintendo", request, "X-EntityToken", requestContext.EntityToken, extraHeaders, requestSettings);
+ if (httpResult is PlayFabError)
+ {
+ var error = (PlayFabError)httpResult;
+ PlayFabSettings.GlobalErrorHandler?.Invoke(error);
+ return new PlayFabResult { Error = error, CustomData = customData };
+ }
+
+ var resultRawJson = (string)httpResult;
+ var resultData = PluginManager.GetPlugin(PluginContract.PlayFab_Serializer).DeserializeObject>(resultRawJson);
+ var result = resultData.data;
+
+ return new PlayFabResult { Result = result, CustomData = customData };
+ }
+
+ ///
+ /// Creates the PSN addon on a title, or updates it if it already exists.
+ ///
+ public async Task> CreateOrUpdatePSNAsync(CreateOrUpdatePSNRequest request, object customData = null, Dictionary extraHeaders = null)
+ {
+ await new PlayFabUtil.SynchronizationContextRemover();
+
+ var requestContext = request?.AuthenticationContext ?? authenticationContext;
+ var requestSettings = apiSettings ?? PlayFabSettings.staticSettings;
+ if (requestContext.EntityToken == null) throw new PlayFabException(PlayFabExceptionCode.EntityTokenNotSet, "Must call Client Login or GetEntityToken before calling this method");
+
+ var httpResult = await PlayFabHttp.DoPost("/Addon/CreateOrUpdatePSN", request, "X-EntityToken", requestContext.EntityToken, extraHeaders, requestSettings);
+ if (httpResult is PlayFabError)
+ {
+ var error = (PlayFabError)httpResult;
+ PlayFabSettings.GlobalErrorHandler?.Invoke(error);
+ return new PlayFabResult { Error = error, CustomData = customData };
+ }
+
+ var resultRawJson = (string)httpResult;
+ var resultData = PluginManager.GetPlugin(PluginContract.PlayFab_Serializer).DeserializeObject>(resultRawJson);
+ var result = resultData.data;
+
+ return new PlayFabResult { Result = result, CustomData = customData };
+ }
+
+ ///
+ /// Creates the Steam addon on a title, or updates it if it already exists.
+ ///
+ public async Task> CreateOrUpdateSteamAsync(CreateOrUpdateSteamRequest request, object customData = null, Dictionary extraHeaders = null)
+ {
+ await new PlayFabUtil.SynchronizationContextRemover();
+
+ var requestContext = request?.AuthenticationContext ?? authenticationContext;
+ var requestSettings = apiSettings ?? PlayFabSettings.staticSettings;
+ if (requestContext.EntityToken == null) throw new PlayFabException(PlayFabExceptionCode.EntityTokenNotSet, "Must call Client Login or GetEntityToken before calling this method");
+
+ var httpResult = await PlayFabHttp.DoPost("/Addon/CreateOrUpdateSteam", request, "X-EntityToken", requestContext.EntityToken, extraHeaders, requestSettings);
+ if (httpResult is PlayFabError)
+ {
+ var error = (PlayFabError)httpResult;
+ PlayFabSettings.GlobalErrorHandler?.Invoke(error);
+ return new PlayFabResult { Error = error, CustomData = customData };
+ }
+
+ var resultRawJson = (string)httpResult;
+ var resultData = PluginManager.GetPlugin(PluginContract.PlayFab_Serializer).DeserializeObject>(resultRawJson);
+ var result = resultData.data;
+
+ return new PlayFabResult { Result = result, CustomData = customData };
+ }
+
+ ///
+ /// Creates the Twitch addon on a title, or updates it if it already exists.
+ ///
+ public async Task> CreateOrUpdateTwitchAsync(CreateOrUpdateTwitchRequest request, object customData = null, Dictionary extraHeaders = null)
+ {
+ await new PlayFabUtil.SynchronizationContextRemover();
+
+ var requestContext = request?.AuthenticationContext ?? authenticationContext;
+ var requestSettings = apiSettings ?? PlayFabSettings.staticSettings;
+ if (requestContext.EntityToken == null) throw new PlayFabException(PlayFabExceptionCode.EntityTokenNotSet, "Must call Client Login or GetEntityToken before calling this method");
+
+ var httpResult = await PlayFabHttp.DoPost("/Addon/CreateOrUpdateTwitch", request, "X-EntityToken", requestContext.EntityToken, extraHeaders, requestSettings);
+ if (httpResult is PlayFabError)
+ {
+ var error = (PlayFabError)httpResult;
+ PlayFabSettings.GlobalErrorHandler?.Invoke(error);
+ return new PlayFabResult { Error = error, CustomData = customData };
+ }
+
+ var resultRawJson = (string)httpResult;
+ var resultData = PluginManager.GetPlugin(PluginContract.PlayFab_Serializer).DeserializeObject>(resultRawJson);
+ var result = resultData.data;
+
+ return new PlayFabResult { Result = result, CustomData = customData };
+ }
+
+ ///
+ /// Deletes the Apple addon on a title.
+ ///
+ public async Task> DeleteAppleAsync(DeleteAppleRequest request, object customData = null, Dictionary extraHeaders = null)
+ {
+ await new PlayFabUtil.SynchronizationContextRemover();
+
+ var requestContext = request?.AuthenticationContext ?? authenticationContext;
+ var requestSettings = apiSettings ?? PlayFabSettings.staticSettings;
+ if (requestContext.EntityToken == null) throw new PlayFabException(PlayFabExceptionCode.EntityTokenNotSet, "Must call Client Login or GetEntityToken before calling this method");
+
+ var httpResult = await PlayFabHttp.DoPost("/Addon/DeleteApple", request, "X-EntityToken", requestContext.EntityToken, extraHeaders, requestSettings);
+ if (httpResult is PlayFabError)
+ {
+ var error = (PlayFabError)httpResult;
+ PlayFabSettings.GlobalErrorHandler?.Invoke(error);
+ return new PlayFabResult { Error = error, CustomData = customData };
+ }
+
+ var resultRawJson = (string)httpResult;
+ var resultData = PluginManager.GetPlugin(PluginContract.PlayFab_Serializer).DeserializeObject>(resultRawJson);
+ var result = resultData.data;
+
+ return new PlayFabResult { Result = result, CustomData = customData };
+ }
+
+ ///
+ /// Deletes the Facebook addon on a title.
+ ///
+ public async Task> DeleteFacebookAsync(DeleteFacebookRequest request, object customData = null, Dictionary extraHeaders = null)
+ {
+ await new PlayFabUtil.SynchronizationContextRemover();
+
+ var requestContext = request?.AuthenticationContext ?? authenticationContext;
+ var requestSettings = apiSettings ?? PlayFabSettings.staticSettings;
+ if (requestContext.EntityToken == null) throw new PlayFabException(PlayFabExceptionCode.EntityTokenNotSet, "Must call Client Login or GetEntityToken before calling this method");
+
+ var httpResult = await PlayFabHttp.DoPost("/Addon/DeleteFacebook", request, "X-EntityToken", requestContext.EntityToken, extraHeaders, requestSettings);
+ if (httpResult is PlayFabError)
+ {
+ var error = (PlayFabError)httpResult;
+ PlayFabSettings.GlobalErrorHandler?.Invoke(error);
+ return new PlayFabResult { Error = error, CustomData = customData };
+ }
+
+ var resultRawJson = (string)httpResult;
+ var resultData = PluginManager.GetPlugin(PluginContract.PlayFab_Serializer).DeserializeObject>(resultRawJson);
+ var result = resultData.data;
+
+ return new PlayFabResult { Result = result, CustomData = customData };
+ }
+
+ ///
+ /// Deletes the Facebook addon on a title.
+ ///
+ public async Task> DeleteFacebookInstantGamesAsync(DeleteFacebookInstantGamesRequest request, object customData = null, Dictionary extraHeaders = null)
+ {
+ await new PlayFabUtil.SynchronizationContextRemover();
+
+ var requestContext = request?.AuthenticationContext ?? authenticationContext;
+ var requestSettings = apiSettings ?? PlayFabSettings.staticSettings;
+ if (requestContext.EntityToken == null) throw new PlayFabException(PlayFabExceptionCode.EntityTokenNotSet, "Must call Client Login or GetEntityToken before calling this method");
+
+ var httpResult = await PlayFabHttp.DoPost("/Addon/DeleteFacebookInstantGames", request, "X-EntityToken", requestContext.EntityToken, extraHeaders, requestSettings);
+ if (httpResult is PlayFabError)
+ {
+ var error = (PlayFabError)httpResult;
+ PlayFabSettings.GlobalErrorHandler?.Invoke(error);
+ return new PlayFabResult { Error = error, CustomData = customData };
+ }
+
+ var resultRawJson = (string)httpResult;
+ var resultData = PluginManager.GetPlugin(PluginContract.PlayFab_Serializer).DeserializeObject>(resultRawJson);
+ var result = resultData.data;
+
+ return new PlayFabResult { Result = result, CustomData = customData };
+ }
+
+ ///
+ /// Deletes the Google addon on a title.
+ ///
+ public async Task> DeleteGoogleAsync(DeleteGoogleRequest request, object customData = null, Dictionary extraHeaders = null)
+ {
+ await new PlayFabUtil.SynchronizationContextRemover();
+
+ var requestContext = request?.AuthenticationContext ?? authenticationContext;
+ var requestSettings = apiSettings ?? PlayFabSettings.staticSettings;
+ if (requestContext.EntityToken == null) throw new PlayFabException(PlayFabExceptionCode.EntityTokenNotSet, "Must call Client Login or GetEntityToken before calling this method");
+
+ var httpResult = await PlayFabHttp.DoPost("/Addon/DeleteGoogle", request, "X-EntityToken", requestContext.EntityToken, extraHeaders, requestSettings);
+ if (httpResult is PlayFabError)
+ {
+ var error = (PlayFabError)httpResult;
+ PlayFabSettings.GlobalErrorHandler?.Invoke(error);
+ return new PlayFabResult { Error = error, CustomData = customData };
+ }
+
+ var resultRawJson = (string)httpResult;
+ var resultData = PluginManager.GetPlugin(PluginContract.PlayFab_Serializer).DeserializeObject>(resultRawJson);
+ var result = resultData.data;
+
+ return new PlayFabResult { Result = result, CustomData = customData };
+ }
+
+ ///
+ /// Deletes the Kongregate addon on a title.
+ ///
+ public async Task> DeleteKongregateAsync(DeleteKongregateRequest request, object customData = null, Dictionary extraHeaders = null)
+ {
+ await new PlayFabUtil.SynchronizationContextRemover();
+
+ var requestContext = request?.AuthenticationContext ?? authenticationContext;
+ var requestSettings = apiSettings ?? PlayFabSettings.staticSettings;
+ if (requestContext.EntityToken == null) throw new PlayFabException(PlayFabExceptionCode.EntityTokenNotSet, "Must call Client Login or GetEntityToken before calling this method");
+
+ var httpResult = await PlayFabHttp.DoPost("/Addon/DeleteKongregate", request, "X-EntityToken", requestContext.EntityToken, extraHeaders, requestSettings);
+ if (httpResult is PlayFabError)
+ {
+ var error = (PlayFabError)httpResult;
+ PlayFabSettings.GlobalErrorHandler?.Invoke(error);
+ return new PlayFabResult { Error = error, CustomData = customData };
+ }
+
+ var resultRawJson = (string)httpResult;
+ var resultData = PluginManager.GetPlugin(PluginContract.PlayFab_Serializer).DeserializeObject>(resultRawJson);
+ var result = resultData.data;
+
+ return new PlayFabResult { Result = result, CustomData = customData };
+ }
+
+ ///
+ /// Deletes the Nintendo addon on a title.
+ ///
+ public async Task> DeleteNintendoAsync(DeleteNintendoRequest request, object customData = null, Dictionary extraHeaders = null)
+ {
+ await new PlayFabUtil.SynchronizationContextRemover();
+
+ var requestContext = request?.AuthenticationContext ?? authenticationContext;
+ var requestSettings = apiSettings ?? PlayFabSettings.staticSettings;
+ if (requestContext.EntityToken == null) throw new PlayFabException(PlayFabExceptionCode.EntityTokenNotSet, "Must call Client Login or GetEntityToken before calling this method");
+
+ var httpResult = await PlayFabHttp.DoPost("/Addon/DeleteNintendo", request, "X-EntityToken", requestContext.EntityToken, extraHeaders, requestSettings);
+ if (httpResult is PlayFabError)
+ {
+ var error = (PlayFabError)httpResult;
+ PlayFabSettings.GlobalErrorHandler?.Invoke(error);
+ return new PlayFabResult { Error = error, CustomData = customData };
+ }
+
+ var resultRawJson = (string)httpResult;
+ var resultData = PluginManager.GetPlugin(PluginContract.PlayFab_Serializer).DeserializeObject>(resultRawJson);
+ var result = resultData.data;
+
+ return new PlayFabResult { Result = result, CustomData = customData };
+ }
+
+ ///