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 }; + } + + /// + /// Deletes the PSN addon on a title. + /// + public async Task> DeletePSNAsync(DeletePSNRequest 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/DeletePSN", 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 Steam addon on a title. + /// + public async Task> DeleteSteamAsync(DeleteSteamRequest 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/DeleteSteam", 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 Twitch addon on a title. + /// + public async Task> DeleteTwitchAsync(DeleteTwitchRequest 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/DeleteTwitch", 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 }; + } + + /// + /// Gets information of the Apple addon on a title, omits secrets. + /// + public async Task> GetAppleAsync(GetAppleRequest 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/GetApple", 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 }; + } + + /// + /// Gets information of the Facebook addon on a title, omits secrets. + /// + public async Task> GetFacebookAsync(GetFacebookRequest 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/GetFacebook", 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 }; + } + + /// + /// Gets information of the Facebook Instant Games addon on a title, omits secrets. + /// + public async Task> GetFacebookInstantGamesAsync(GetFacebookInstantGamesRequest 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/GetFacebookInstantGames", 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 }; + } + + /// + /// Gets information of the Google addon on a title, omits secrets. + /// + public async Task> GetGoogleAsync(GetGoogleRequest 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/GetGoogle", 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 }; + } + + /// + /// Gets information of the Kongregate addon on a title, omits secrets. + /// + public async Task> GetKongregateAsync(GetKongregateRequest 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/GetKongregate", 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 }; + } + + /// + /// Gets information of the Nintendo addon on a title, omits secrets. + /// + public async Task> GetNintendoAsync(GetNintendoRequest 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/GetNintendo", 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 }; + } + + /// + /// Gets information of the PSN addon on a title, omits secrets. + /// + public async Task> GetPSNAsync(GetPSNRequest 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/GetPSN", 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 }; + } + + /// + /// Gets information of the Steam addon on a title, omits secrets. + /// + public async Task> GetSteamAsync(GetSteamRequest 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/GetSteam", 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 }; + } + + /// + /// Gets information of the Twitch addon on a title, omits secrets. + /// + public async Task> GetTwitchAsync(GetTwitchRequest 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/GetTwitch", 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 }; + } + +} +} +#endif diff --git a/PlayFabSDK/source/PlayFabAddonModels.cs b/PlayFabSDK/source/PlayFabAddonModels.cs new file mode 100644 index 00000000..b299259f --- /dev/null +++ b/PlayFabSDK/source/PlayFabAddonModels.cs @@ -0,0 +1,843 @@ +using PlayFab.Internal; +using System; +using System.Collections.Generic; + +namespace PlayFab.AddonModels +{ + public class CreateOrUpdateAppleRequest : PlayFabRequestCommon + { + /// + /// iOS App Bundle ID obtained after setting up your app in the App Store. + /// + public string AppBundleId ; + + /// + /// iOS App Shared Secret obtained after setting up your app in the App Store. + /// + public string AppSharedSecret ; + + /// + /// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). + /// + public Dictionary CustomTags ; + + /// + /// The optional entity to perform this action on. Defaults to the currently logged in entity. + /// + public EntityKey Entity ; + + /// + /// If an error should be returned if the addon already exists. + /// + public bool? ErrorIfExists ; + + /// + /// Ignore expiration date for identity tokens. Be aware that when set to true this can invalidate expired tokens in the + /// case where Apple rotates their signing keys. + /// + public bool? IgnoreExpirationDate ; + + /// + /// Require secure authentication only for this app. + /// + public bool? RequireSecureAuthentication ; + + } + + public class CreateOrUpdateAppleResponse : PlayFabResultCommon + { + } + + public class CreateOrUpdateFacebookInstantGamesRequest : PlayFabRequestCommon + { + /// + /// Facebook App ID obtained after setting up your app in Facebook Instant Games. + /// + public string AppID ; + + /// + /// Facebook App Secret obtained after setting up your app in Facebook Instant Games. + /// + public string AppSecret ; + + /// + /// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). + /// + public Dictionary CustomTags ; + + /// + /// The optional entity to perform this action on. Defaults to the currently logged in entity. + /// + public EntityKey Entity ; + + /// + /// If an error should be returned if the addon already exists. + /// + public bool? ErrorIfExists ; + + } + + public class CreateOrUpdateFacebookInstantGamesResponse : PlayFabResultCommon + { + } + + public class CreateOrUpdateFacebookRequest : PlayFabRequestCommon + { + /// + /// Facebook App ID obtained after setting up your app in Facebook. + /// + public string AppID ; + + /// + /// Facebook App Secret obtained after setting up your app in Facebook. + /// + public string AppSecret ; + + /// + /// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). + /// + public Dictionary CustomTags ; + + /// + /// The optional entity to perform this action on. Defaults to the currently logged in entity. + /// + public EntityKey Entity ; + + /// + /// If an error should be returned if the addon already exists. + /// + public bool? ErrorIfExists ; + + /// + /// Email address for purchase dispute notifications. + /// + public string NotificationEmail ; + + } + + public class CreateOrUpdateFacebookResponse : PlayFabResultCommon + { + } + + public class CreateOrUpdateGoogleRequest : PlayFabRequestCommon + { + /// + /// Google App License Key obtained after setting up your app in the Google Play developer portal. Required if using Google + /// receipt validation. + /// + public string AppLicenseKey ; + + /// + /// Google App Package ID obtained after setting up your app in the Google Play developer portal. Required if using Google + /// receipt validation. + /// + public string AppPackageID ; + + /// + /// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). + /// + public Dictionary CustomTags ; + + /// + /// The optional entity to perform this action on. Defaults to the currently logged in entity. + /// + public EntityKey Entity ; + + /// + /// If an error should be returned if the addon already exists. + /// + public bool? ErrorIfExists ; + + /// + /// Google OAuth Client ID obtained through the Google Developer Console by creating a new set of "OAuth Client ID". + /// Required if using Google Authentication. + /// + public string OAuthClientID ; + + /// + /// Google OAuth Client Secret obtained through the Google Developer Console by creating a new set of "OAuth Client ID". + /// Required if using Google Authentication. + /// + public string OAuthClientSecret ; + + /// + /// Needed to enable pending purchase handling and subscription processing. + /// + public string ServiceAccountKey ; + + } + + public class CreateOrUpdateGoogleResponse : PlayFabResultCommon + { + } + + public class CreateOrUpdateKongregateRequest : PlayFabRequestCommon + { + /// + /// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). + /// + public Dictionary CustomTags ; + + /// + /// The optional entity to perform this action on. Defaults to the currently logged in entity. + /// + public EntityKey Entity ; + + /// + /// If an error should be returned if the addon already exists. + /// + public bool? ErrorIfExists ; + + /// + /// Kongregate Secret API Key obtained after setting up your game in your Kongregate developer account. + /// + public string SecretAPIKey ; + + } + + public class CreateOrUpdateKongregateResponse : PlayFabResultCommon + { + } + + public class CreateOrUpdateNintendoRequest : PlayFabRequestCommon + { + /// + /// Nintendo Switch Application ID, without the "0x" prefix. + /// + public string ApplicationID ; + + /// + /// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). + /// + public Dictionary CustomTags ; + + /// + /// The optional entity to perform this action on. Defaults to the currently logged in entity. + /// + public EntityKey Entity ; + + /// + /// List of Nintendo Environments, currently supporting up to 4. Needs Catalog enabled. + /// + public List Environments ; + + /// + /// If an error should be returned if the addon already exists. + /// + public bool? ErrorIfExists ; + + } + + public class CreateOrUpdateNintendoResponse : PlayFabResultCommon + { + } + + public class CreateOrUpdatePSNRequest : PlayFabRequestCommon + { + /// + /// Client ID obtained after setting up your game with Sony. This one is associated with the existing PS4 marketplace. + /// + public string ClientID ; + + /// + /// Client secret obtained after setting up your game with Sony. This one is associated with the existing PS4 marketplace. + /// + public string ClientSecret ; + + /// + /// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). + /// + public Dictionary CustomTags ; + + /// + /// The optional entity to perform this action on. Defaults to the currently logged in entity. + /// + public EntityKey Entity ; + + /// + /// If an error should be returned if the addon already exists. + /// + public bool? ErrorIfExists ; + + /// + /// Client ID obtained after setting up your game with Sony. This one is associated with the modern marketplace, which + /// includes PS5, cross-generation for PS4, and unified entitlements. + /// + public string NextGenClientID ; + + /// + /// Client secret obtained after setting up your game with Sony. This one is associated with the modern marketplace, which + /// includes PS5, cross-generation for PS4, and unified entitlements. + /// + public string NextGenClientSecret ; + + } + + public class CreateOrUpdatePSNResponse : PlayFabResultCommon + { + } + + public class CreateOrUpdateSteamRequest : PlayFabRequestCommon + { + /// + /// Application ID obtained after setting up your app in Valve's developer portal. + /// + public string ApplicationId ; + + /// + /// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). + /// + public Dictionary CustomTags ; + + /// + /// Enforce usage of AzurePlayFab identity in user authentication tickets. + /// + public bool? EnforceServiceSpecificTickets ; + + /// + /// The optional entity to perform this action on. Defaults to the currently logged in entity. + /// + public EntityKey Entity ; + + /// + /// If an error should be returned if the addon already exists. + /// + public bool? ErrorIfExists ; + + /// + /// Sercet Key obtained after setting up your app in Valve's developer portal. + /// + public string SecretKey ; + + /// + /// Use Steam Payments sandbox endpoint for test transactions. + /// + public bool? UseSandbox ; + + } + + public class CreateOrUpdateSteamResponse : PlayFabResultCommon + { + } + + public class CreateOrUpdateTwitchRequest : PlayFabRequestCommon + { + /// + /// Client ID obtained after creating your Twitch developer account. + /// + public string ClientID ; + + /// + /// Client Secret obtained after creating your Twitch developer account. + /// + public string ClientSecret ; + + /// + /// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). + /// + public Dictionary CustomTags ; + + /// + /// The optional entity to perform this action on. Defaults to the currently logged in entity. + /// + public EntityKey Entity ; + + /// + /// If an error should be returned if the addon already exists. + /// + public bool? ErrorIfExists ; + + } + + public class CreateOrUpdateTwitchResponse : PlayFabResultCommon + { + } + + public class DeleteAppleRequest : PlayFabRequestCommon + { + /// + /// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). + /// + public Dictionary CustomTags ; + + /// + /// The optional entity to perform this action on. Defaults to the currently logged in entity. + /// + public EntityKey Entity ; + + } + + public class DeleteAppleResponse : PlayFabResultCommon + { + } + + public class DeleteFacebookInstantGamesRequest : PlayFabRequestCommon + { + /// + /// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). + /// + public Dictionary CustomTags ; + + /// + /// The optional entity to perform this action on. Defaults to the currently logged in entity. + /// + public EntityKey Entity ; + + } + + public class DeleteFacebookInstantGamesResponse : PlayFabResultCommon + { + } + + public class DeleteFacebookRequest : PlayFabRequestCommon + { + /// + /// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). + /// + public Dictionary CustomTags ; + + /// + /// The optional entity to perform this action on. Defaults to the currently logged in entity. + /// + public EntityKey Entity ; + + } + + public class DeleteFacebookResponse : PlayFabResultCommon + { + } + + public class DeleteGoogleRequest : PlayFabRequestCommon + { + /// + /// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). + /// + public Dictionary CustomTags ; + + /// + /// The optional entity to perform this action on. Defaults to the currently logged in entity. + /// + public EntityKey Entity ; + + } + + public class DeleteGoogleResponse : PlayFabResultCommon + { + } + + public class DeleteKongregateRequest : PlayFabRequestCommon + { + /// + /// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). + /// + public Dictionary CustomTags ; + + /// + /// The optional entity to perform this action on. Defaults to the currently logged in entity. + /// + public EntityKey Entity ; + + } + + public class DeleteKongregateResponse : PlayFabResultCommon + { + } + + public class DeleteNintendoRequest : PlayFabRequestCommon + { + /// + /// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). + /// + public Dictionary CustomTags ; + + /// + /// The optional entity to perform this action on. Defaults to the currently logged in entity. + /// + public EntityKey Entity ; + + } + + public class DeleteNintendoResponse : PlayFabResultCommon + { + } + + public class DeletePSNRequest : PlayFabRequestCommon + { + /// + /// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). + /// + public Dictionary CustomTags ; + + /// + /// The optional entity to perform this action on. Defaults to the currently logged in entity. + /// + public EntityKey Entity ; + + } + + public class DeletePSNResponse : PlayFabResultCommon + { + } + + public class DeleteSteamRequest : PlayFabRequestCommon + { + /// + /// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). + /// + public Dictionary CustomTags ; + + /// + /// The optional entity to perform this action on. Defaults to the currently logged in entity. + /// + public EntityKey Entity ; + + } + + public class DeleteSteamResponse : PlayFabResultCommon + { + } + + public class DeleteTwitchRequest : PlayFabRequestCommon + { + /// + /// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). + /// + public Dictionary CustomTags ; + + /// + /// The optional entity to perform this action on. Defaults to the currently logged in entity. + /// + public EntityKey Entity ; + + } + + public class DeleteTwitchResponse : PlayFabResultCommon + { + } + + /// + /// Combined entity type and ID structure which uniquely identifies a single entity. + /// + public class EntityKey + { + /// + /// Unique ID of the entity. + /// + public string Id { get; set; } + + /// + /// Entity type. See https://docs.microsoft.com/gaming/playfab/features/data/entities/available-built-in-entity-types + /// + public string Type { get; set; } + + } + + public class GetAppleRequest : PlayFabRequestCommon + { + /// + /// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). + /// + public Dictionary CustomTags ; + + /// + /// The optional entity to perform this action on. Defaults to the currently logged in entity. + /// + public EntityKey Entity ; + + } + + public class GetAppleResponse : PlayFabResultCommon + { + /// + /// iOS App Bundle ID obtained after setting up your app in the App Store. + /// + public string AppBundleId ; + + /// + /// Addon status. + /// + public bool Created ; + + /// + /// Ignore expiration date for identity tokens. + /// + public bool? IgnoreExpirationDate ; + + /// + /// Require secure authentication only for this app. + /// + public bool? RequireSecureAuthentication ; + + } + + public class GetFacebookInstantGamesRequest : PlayFabRequestCommon + { + /// + /// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). + /// + public Dictionary CustomTags ; + + /// + /// The optional entity to perform this action on. Defaults to the currently logged in entity. + /// + public EntityKey Entity ; + + } + + public class GetFacebookInstantGamesResponse : PlayFabResultCommon + { + /// + /// Facebook App ID obtained after setting up your app in Facebook Instant Games. + /// + public string AppID ; + + /// + /// Addon status. + /// + public bool Created ; + + } + + public class GetFacebookRequest : PlayFabRequestCommon + { + /// + /// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). + /// + public Dictionary CustomTags ; + + /// + /// The optional entity to perform this action on. Defaults to the currently logged in entity. + /// + public EntityKey Entity ; + + } + + public class GetFacebookResponse : PlayFabResultCommon + { + /// + /// Facebook App ID obtained after setting up your app in Facebook. + /// + public string AppID ; + + /// + /// Addon status. + /// + public bool Created ; + + /// + /// Email address for purchase dispute notifications. + /// + public string NotificationEmail ; + + } + + public class GetGoogleRequest : PlayFabRequestCommon + { + /// + /// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). + /// + public Dictionary CustomTags ; + + /// + /// The optional entity to perform this action on. Defaults to the currently logged in entity. + /// + public EntityKey Entity ; + + } + + public class GetGoogleResponse : PlayFabResultCommon + { + /// + /// Google App Package ID obtained after setting up your app in the Google Play developer portal. Required if using Google + /// receipt validation. + /// + public string AppPackageID ; + + /// + /// Addon status. + /// + public bool Created ; + + /// + /// Google OAuth Client ID obtained through the Google Developer Console by creating a new set of "OAuth Client ID". + /// Required if using Google Authentication. + /// + public string OAuthClientID ; + + } + + public class GetKongregateRequest : PlayFabRequestCommon + { + /// + /// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). + /// + public Dictionary CustomTags ; + + /// + /// The optional entity to perform this action on. Defaults to the currently logged in entity. + /// + public EntityKey Entity ; + + } + + public class GetKongregateResponse : PlayFabResultCommon + { + /// + /// Addon status. + /// + public bool Created ; + + } + + public class GetNintendoRequest : PlayFabRequestCommon + { + /// + /// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). + /// + public Dictionary CustomTags ; + + /// + /// The optional entity to perform this action on. Defaults to the currently logged in entity. + /// + public EntityKey Entity ; + + } + + public class GetNintendoResponse : PlayFabResultCommon + { + /// + /// Nintendo Switch Application ID, without the "0x" prefix. + /// + public string ApplicationID ; + + /// + /// Addon status. + /// + public bool Created ; + + /// + /// List of Nintendo Environments, currently supporting up to 4. + /// + public List Environments ; + + } + + public class GetPSNRequest : PlayFabRequestCommon + { + /// + /// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). + /// + public Dictionary CustomTags ; + + /// + /// The optional entity to perform this action on. Defaults to the currently logged in entity. + /// + public EntityKey Entity ; + + } + + public class GetPSNResponse : PlayFabResultCommon + { + /// + /// Client ID obtained after setting up your game with Sony. This one is associated with the existing PS4 marketplace. + /// + public string ClientID ; + + /// + /// Addon status. + /// + public bool Created ; + + /// + /// Client ID obtained after setting up your game with Sony. This one is associated with the modern marketplace, which + /// includes PS5, cross-generation for PS4, and unified entitlements. + /// + public string NextGenClientID ; + + } + + public class GetSteamRequest : PlayFabRequestCommon + { + /// + /// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). + /// + public Dictionary CustomTags ; + + /// + /// The optional entity to perform this action on. Defaults to the currently logged in entity. + /// + public EntityKey Entity ; + + } + + public class GetSteamResponse : PlayFabResultCommon + { + /// + /// Application ID obtained after setting up your game in Valve's developer portal. + /// + public string ApplicationId ; + + /// + /// Addon status. + /// + public bool Created ; + + /// + /// Enforce usage of AzurePlayFab identity in user authentication tickets. + /// + public bool? EnforceServiceSpecificTickets ; + + /// + /// Use Steam Payments sandbox endpoint for test transactions. + /// + public bool? UseSandbox ; + + } + + public class GetTwitchRequest : PlayFabRequestCommon + { + /// + /// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). + /// + public Dictionary CustomTags ; + + /// + /// The optional entity to perform this action on. Defaults to the currently logged in entity. + /// + public EntityKey Entity ; + + } + + public class GetTwitchResponse : PlayFabResultCommon + { + /// + /// Client ID obtained after creating your Twitch developer account. + /// + public string ClientID ; + + /// + /// Addon status. + /// + public bool Created ; + + } + + public class NintendoEnvironment + { + /// + /// Client ID for the Nintendo Environment. + /// + public string ClientID ; + + /// + /// Client Secret for the Nintendo Environment. + /// + public string ClientSecret ; + + /// + /// ID for the Nintendo Environment. + /// + public string ID ; + + } +} diff --git a/PlayFabSDK/source/PlayFabAdminModels.cs b/PlayFabSDK/source/PlayFabAdminModels.cs index 9b89e58b..12a6ad75 100644 --- a/PlayFabSDK/source/PlayFabAdminModels.cs +++ b/PlayFabSDK/source/PlayFabAdminModels.cs @@ -3081,6 +3081,12 @@ public enum GenericErrorCodes GameSaveManifestNotFound, GameSaveManifestVersionAlreadyExists, GameSaveConflictUpdatingManifest, + GameSaveManifestUpdatesNotAllowed, + GameSaveFileAlreadyExists, + GameSaveManifestVersionNotFinalized, + GameSaveUnknownFileInManifest, + GameSaveFileExceededReportedSize, + GameSaveFileNotUploaded, StateShareForbidden, StateShareTitleNotInFlight, StateShareStateNotFound, diff --git a/PlayFabSDK/source/PlayFabClientModels.cs b/PlayFabSDK/source/PlayFabClientModels.cs index d6944634..94f0a51a 100644 --- a/PlayFabSDK/source/PlayFabClientModels.cs +++ b/PlayFabSDK/source/PlayFabClientModels.cs @@ -2077,8 +2077,9 @@ public class GetFriendsListRequest : PlayFabRequestCommon /// /// If any additional services are queried for the user's friends, those friends who also have a PlayFab account registered /// for the title will be returned in the results. For Facebook, user has to have logged into the title's Facebook app - /// recently, and only friends who also plays this game will be included. For Xbox Live, user has to have logged into the - /// Xbox Live recently, and only friends who also play this game will be included. + /// recently, and only friends who also plays this game will be included. Note: If the user authenticated with + /// AuthenticationToken when calling LoginWithFacebook, instead of AcessToken, an empty list will be returned. For Xbox + /// Live, user has to have logged into the Xbox Live recently, and only friends who also play this game will be included. /// public class GetFriendsListResult : PlayFabResultCommon { @@ -4424,7 +4425,8 @@ public class LoginWithFacebookInstantGamesIdRequest : PlayFabRequestCommon /// 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. + /// the first Title ID. Note: If the user is authenticated with AuthenticationToken, instead of AccessToken, the + /// GetFriendsList API will return an empty list. /// public class LoginWithFacebookRequest : PlayFabRequestCommon { @@ -4433,6 +4435,11 @@ public class LoginWithFacebookRequest : PlayFabRequestCommon /// public string AccessToken ; + /// + /// Token used for limited login authentication. + /// + public string AuthenticationToken ; + /// /// Automatically create a PlayFab account if one is not currently linked to this ID. /// diff --git a/PlayFabSDK/source/PlayFabErrors.cs b/PlayFabSDK/source/PlayFabErrors.cs index 780309ee..dbe90053 100644 --- a/PlayFabSDK/source/PlayFabErrors.cs +++ b/PlayFabSDK/source/PlayFabErrors.cs @@ -863,6 +863,12 @@ public enum PlayFabErrorCode GameSaveManifestNotFound = 20300, GameSaveManifestVersionAlreadyExists = 20301, GameSaveConflictUpdatingManifest = 20302, + GameSaveManifestUpdatesNotAllowed = 20303, + GameSaveFileAlreadyExists = 20304, + GameSaveManifestVersionNotFinalized = 20305, + GameSaveUnknownFileInManifest = 20306, + GameSaveFileExceededReportedSize = 20307, + GameSaveFileNotUploaded = 20308, StateShareForbidden = 21000, StateShareTitleNotInFlight = 21001, StateShareStateNotFound = 21002, diff --git a/PlayFabSDK/source/PlayFabLeaderboardsAPI.cs b/PlayFabSDK/source/PlayFabProgressionAPI.cs similarity index 99% rename from PlayFabSDK/source/PlayFabLeaderboardsAPI.cs rename to PlayFabSDK/source/PlayFabProgressionAPI.cs index e4cc5a02..761d6e35 100644 --- a/PlayFabSDK/source/PlayFabLeaderboardsAPI.cs +++ b/PlayFabSDK/source/PlayFabProgressionAPI.cs @@ -1,6 +1,6 @@ #if !DISABLE_PLAYFABENTITY_API && !DISABLE_PLAYFAB_STATIC_API -using PlayFab.LeaderboardsModels; +using PlayFab.ProgressionModels; using PlayFab.Internal; #pragma warning disable 0649 using System; @@ -13,9 +13,9 @@ namespace PlayFab { /// - /// Manage entity statistics Manage entity statistics + /// Manage entity statistics Manage entity leaderboards /// - public static class PlayFabLeaderboardsAPI + public static class PlayFabProgressionAPI { /// /// Verify entity login. diff --git a/PlayFabSDK/source/PlayFabLeaderboardsInstanceAPI.cs b/PlayFabSDK/source/PlayFabProgressionInstanceAPI.cs similarity index 99% rename from PlayFabSDK/source/PlayFabLeaderboardsInstanceAPI.cs rename to PlayFabSDK/source/PlayFabProgressionInstanceAPI.cs index 653896cb..67fafcb3 100644 --- a/PlayFabSDK/source/PlayFabLeaderboardsInstanceAPI.cs +++ b/PlayFabSDK/source/PlayFabProgressionInstanceAPI.cs @@ -1,6 +1,6 @@ #if !DISABLE_PLAYFABENTITY_API -using PlayFab.LeaderboardsModels; +using PlayFab.ProgressionModels; using PlayFab.Internal; #pragma warning disable 0649 using System; @@ -13,21 +13,21 @@ namespace PlayFab { /// - /// Manage entity statistics Manage entity statistics + /// Manage entity statistics Manage entity leaderboards /// - public class PlayFabLeaderboardsInstanceAPI + public class PlayFabProgressionInstanceAPI { public readonly PlayFabApiSettings apiSettings = null; public readonly PlayFabAuthenticationContext authenticationContext = null; - public PlayFabLeaderboardsInstanceAPI(PlayFabAuthenticationContext context) + public PlayFabProgressionInstanceAPI(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 PlayFabLeaderboardsInstanceAPI(PlayFabApiSettings settings, PlayFabAuthenticationContext context) + public PlayFabProgressionInstanceAPI(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"); diff --git a/XamarinTestRunner/XamarinTestRunner/PlayFabSDK/PlayFabLeaderboardsModels.cs b/PlayFabSDK/source/PlayFabProgressionModels.cs similarity index 99% rename from XamarinTestRunner/XamarinTestRunner/PlayFabSDK/PlayFabLeaderboardsModels.cs rename to PlayFabSDK/source/PlayFabProgressionModels.cs index bfe7ad91..afd3cf76 100644 --- a/XamarinTestRunner/XamarinTestRunner/PlayFabSDK/PlayFabLeaderboardsModels.cs +++ b/PlayFabSDK/source/PlayFabProgressionModels.cs @@ -2,7 +2,7 @@ using System; using System.Collections.Generic; -namespace PlayFab.LeaderboardsModels +namespace PlayFab.ProgressionModels { public class CreateLeaderboardDefinitionRequest : PlayFabRequestCommon { diff --git a/PlayFabSDK/source/PlayFabSDK.csproj b/PlayFabSDK/source/PlayFabSDK.csproj index de070f16..d1b960ee 100644 --- a/PlayFabSDK/source/PlayFabSDK.csproj +++ b/PlayFabSDK/source/PlayFabSDK.csproj @@ -8,7 +8,7 @@ 512 PlayFabAllSDK - 1.185.240802 + 1.187.240816 PlayFab CSharp Sdk Microsoft Microsoft @@ -21,7 +21,7 @@ PlayFab PlayFabSDK PlayFab, Baas, Paas, JSON, REST, HTTP, SSL, API, cloud, liveops, game, gamedev, native - https://docs.microsoft.com/gaming/playfab/release-notes#240802 + https://docs.microsoft.com/gaming/playfab/release-notes#240816 en 1 1 diff --git a/PlayFabSDK/source/PlayFabServerModels.cs b/PlayFabSDK/source/PlayFabServerModels.cs index c12e42ab..dafd3814 100644 --- a/PlayFabSDK/source/PlayFabServerModels.cs +++ b/PlayFabSDK/source/PlayFabServerModels.cs @@ -2401,6 +2401,12 @@ public enum GenericErrorCodes GameSaveManifestNotFound, GameSaveManifestVersionAlreadyExists, GameSaveConflictUpdatingManifest, + GameSaveManifestUpdatesNotAllowed, + GameSaveFileAlreadyExists, + GameSaveManifestVersionNotFinalized, + GameSaveUnknownFileInManifest, + GameSaveFileExceededReportedSize, + GameSaveFileNotUploaded, StateShareForbidden, StateShareTitleNotInFlight, StateShareStateNotFound, diff --git a/PlayFabSDK/source/PlayFabSettings.cs b/PlayFabSDK/source/PlayFabSettings.cs index e57ca1a3..d1e06460 100644 --- a/PlayFabSDK/source/PlayFabSettings.cs +++ b/PlayFabSDK/source/PlayFabSettings.cs @@ -6,9 +6,9 @@ namespace PlayFab { public class PlayFabSettings { - public const string SdkVersion = "1.185.240802"; - public const string BuildIdentifier = "adobuild_csharpsdk_114"; - public const string SdkVersionString = "CSharpSDK-1.185.240802"; + public const string SdkVersion = "1.187.240816"; + public const string BuildIdentifier = "adobuild_csharpsdk_118"; + public const string SdkVersionString = "CSharpSDK-1.187.240816"; /// This is only for customers running a private cluster. Generally you shouldn't touch this public static string DefaultProductionEnvironmentUrl = "playfabapi.com"; diff --git a/Plugins/CloudScript/source/PlayFabCloudScriptPlugin.csproj b/Plugins/CloudScript/source/PlayFabCloudScriptPlugin.csproj index 39bc1015..ae369b2c 100644 --- a/Plugins/CloudScript/source/PlayFabCloudScriptPlugin.csproj +++ b/Plugins/CloudScript/source/PlayFabCloudScriptPlugin.csproj @@ -8,7 +8,7 @@ 512 PlayFabCloudScriptPlugin - 1.185.240802-alpha + 1.187.240816-alpha PlayFab CSharp CloudScript Plugin Microsoft Microsoft @@ -21,7 +21,7 @@ PlayFabCloudScriptPlugin Copyright 2024 PlayFab, Baas, Paas, JSON, REST, HTTP, SSL, API, cloud, liveops, game, gamedev, native - https://docs.microsoft.com/gaming/playfab/release-notes#240802 + https://docs.microsoft.com/gaming/playfab/release-notes#240816 en 1 1 @@ -45,7 +45,7 @@ - + diff --git a/XamarinTestRunner/XamarinTestRunner/PlayFabSDK/PlayFabAddonAPI.cs b/XamarinTestRunner/XamarinTestRunner/PlayFabSDK/PlayFabAddonAPI.cs new file mode 100644 index 00000000..22960986 --- /dev/null +++ b/XamarinTestRunner/XamarinTestRunner/PlayFabSDK/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/XamarinTestRunner/XamarinTestRunner/PlayFabSDK/PlayFabAddonInstanceAPI.cs b/XamarinTestRunner/XamarinTestRunner/PlayFabSDK/PlayFabAddonInstanceAPI.cs new file mode 100644 index 00000000..2da234ba --- /dev/null +++ b/XamarinTestRunner/XamarinTestRunner/PlayFabSDK/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 }; + } + + /// + /// Deletes the PSN addon on a title. + /// + public async Task> DeletePSNAsync(DeletePSNRequest 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/DeletePSN", 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 Steam addon on a title. + /// + public async Task> DeleteSteamAsync(DeleteSteamRequest 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/DeleteSteam", 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 Twitch addon on a title. + /// + public async Task> DeleteTwitchAsync(DeleteTwitchRequest 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/DeleteTwitch", 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 }; + } + + /// + /// Gets information of the Apple addon on a title, omits secrets. + /// + public async Task> GetAppleAsync(GetAppleRequest 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/GetApple", 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 }; + } + + /// + /// Gets information of the Facebook addon on a title, omits secrets. + /// + public async Task> GetFacebookAsync(GetFacebookRequest 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/GetFacebook", 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 }; + } + + /// + /// Gets information of the Facebook Instant Games addon on a title, omits secrets. + /// + public async Task> GetFacebookInstantGamesAsync(GetFacebookInstantGamesRequest 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/GetFacebookInstantGames", 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 }; + } + + /// + /// Gets information of the Google addon on a title, omits secrets. + /// + public async Task> GetGoogleAsync(GetGoogleRequest 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/GetGoogle", 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 }; + } + + /// + /// Gets information of the Kongregate addon on a title, omits secrets. + /// + public async Task> GetKongregateAsync(GetKongregateRequest 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/GetKongregate", 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 }; + } + + /// + /// Gets information of the Nintendo addon on a title, omits secrets. + /// + public async Task> GetNintendoAsync(GetNintendoRequest 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/GetNintendo", 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 }; + } + + /// + /// Gets information of the PSN addon on a title, omits secrets. + /// + public async Task> GetPSNAsync(GetPSNRequest 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/GetPSN", 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 }; + } + + /// + /// Gets information of the Steam addon on a title, omits secrets. + /// + public async Task> GetSteamAsync(GetSteamRequest 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/GetSteam", 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 }; + } + + /// + /// Gets information of the Twitch addon on a title, omits secrets. + /// + public async Task> GetTwitchAsync(GetTwitchRequest 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/GetTwitch", 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 }; + } + +} +} +#endif diff --git a/XamarinTestRunner/XamarinTestRunner/PlayFabSDK/PlayFabAddonModels.cs b/XamarinTestRunner/XamarinTestRunner/PlayFabSDK/PlayFabAddonModels.cs new file mode 100644 index 00000000..b299259f --- /dev/null +++ b/XamarinTestRunner/XamarinTestRunner/PlayFabSDK/PlayFabAddonModels.cs @@ -0,0 +1,843 @@ +using PlayFab.Internal; +using System; +using System.Collections.Generic; + +namespace PlayFab.AddonModels +{ + public class CreateOrUpdateAppleRequest : PlayFabRequestCommon + { + /// + /// iOS App Bundle ID obtained after setting up your app in the App Store. + /// + public string AppBundleId ; + + /// + /// iOS App Shared Secret obtained after setting up your app in the App Store. + /// + public string AppSharedSecret ; + + /// + /// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). + /// + public Dictionary CustomTags ; + + /// + /// The optional entity to perform this action on. Defaults to the currently logged in entity. + /// + public EntityKey Entity ; + + /// + /// If an error should be returned if the addon already exists. + /// + public bool? ErrorIfExists ; + + /// + /// Ignore expiration date for identity tokens. Be aware that when set to true this can invalidate expired tokens in the + /// case where Apple rotates their signing keys. + /// + public bool? IgnoreExpirationDate ; + + /// + /// Require secure authentication only for this app. + /// + public bool? RequireSecureAuthentication ; + + } + + public class CreateOrUpdateAppleResponse : PlayFabResultCommon + { + } + + public class CreateOrUpdateFacebookInstantGamesRequest : PlayFabRequestCommon + { + /// + /// Facebook App ID obtained after setting up your app in Facebook Instant Games. + /// + public string AppID ; + + /// + /// Facebook App Secret obtained after setting up your app in Facebook Instant Games. + /// + public string AppSecret ; + + /// + /// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). + /// + public Dictionary CustomTags ; + + /// + /// The optional entity to perform this action on. Defaults to the currently logged in entity. + /// + public EntityKey Entity ; + + /// + /// If an error should be returned if the addon already exists. + /// + public bool? ErrorIfExists ; + + } + + public class CreateOrUpdateFacebookInstantGamesResponse : PlayFabResultCommon + { + } + + public class CreateOrUpdateFacebookRequest : PlayFabRequestCommon + { + /// + /// Facebook App ID obtained after setting up your app in Facebook. + /// + public string AppID ; + + /// + /// Facebook App Secret obtained after setting up your app in Facebook. + /// + public string AppSecret ; + + /// + /// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). + /// + public Dictionary CustomTags ; + + /// + /// The optional entity to perform this action on. Defaults to the currently logged in entity. + /// + public EntityKey Entity ; + + /// + /// If an error should be returned if the addon already exists. + /// + public bool? ErrorIfExists ; + + /// + /// Email address for purchase dispute notifications. + /// + public string NotificationEmail ; + + } + + public class CreateOrUpdateFacebookResponse : PlayFabResultCommon + { + } + + public class CreateOrUpdateGoogleRequest : PlayFabRequestCommon + { + /// + /// Google App License Key obtained after setting up your app in the Google Play developer portal. Required if using Google + /// receipt validation. + /// + public string AppLicenseKey ; + + /// + /// Google App Package ID obtained after setting up your app in the Google Play developer portal. Required if using Google + /// receipt validation. + /// + public string AppPackageID ; + + /// + /// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). + /// + public Dictionary CustomTags ; + + /// + /// The optional entity to perform this action on. Defaults to the currently logged in entity. + /// + public EntityKey Entity ; + + /// + /// If an error should be returned if the addon already exists. + /// + public bool? ErrorIfExists ; + + /// + /// Google OAuth Client ID obtained through the Google Developer Console by creating a new set of "OAuth Client ID". + /// Required if using Google Authentication. + /// + public string OAuthClientID ; + + /// + /// Google OAuth Client Secret obtained through the Google Developer Console by creating a new set of "OAuth Client ID". + /// Required if using Google Authentication. + /// + public string OAuthClientSecret ; + + /// + /// Needed to enable pending purchase handling and subscription processing. + /// + public string ServiceAccountKey ; + + } + + public class CreateOrUpdateGoogleResponse : PlayFabResultCommon + { + } + + public class CreateOrUpdateKongregateRequest : PlayFabRequestCommon + { + /// + /// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). + /// + public Dictionary CustomTags ; + + /// + /// The optional entity to perform this action on. Defaults to the currently logged in entity. + /// + public EntityKey Entity ; + + /// + /// If an error should be returned if the addon already exists. + /// + public bool? ErrorIfExists ; + + /// + /// Kongregate Secret API Key obtained after setting up your game in your Kongregate developer account. + /// + public string SecretAPIKey ; + + } + + public class CreateOrUpdateKongregateResponse : PlayFabResultCommon + { + } + + public class CreateOrUpdateNintendoRequest : PlayFabRequestCommon + { + /// + /// Nintendo Switch Application ID, without the "0x" prefix. + /// + public string ApplicationID ; + + /// + /// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). + /// + public Dictionary CustomTags ; + + /// + /// The optional entity to perform this action on. Defaults to the currently logged in entity. + /// + public EntityKey Entity ; + + /// + /// List of Nintendo Environments, currently supporting up to 4. Needs Catalog enabled. + /// + public List Environments ; + + /// + /// If an error should be returned if the addon already exists. + /// + public bool? ErrorIfExists ; + + } + + public class CreateOrUpdateNintendoResponse : PlayFabResultCommon + { + } + + public class CreateOrUpdatePSNRequest : PlayFabRequestCommon + { + /// + /// Client ID obtained after setting up your game with Sony. This one is associated with the existing PS4 marketplace. + /// + public string ClientID ; + + /// + /// Client secret obtained after setting up your game with Sony. This one is associated with the existing PS4 marketplace. + /// + public string ClientSecret ; + + /// + /// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). + /// + public Dictionary CustomTags ; + + /// + /// The optional entity to perform this action on. Defaults to the currently logged in entity. + /// + public EntityKey Entity ; + + /// + /// If an error should be returned if the addon already exists. + /// + public bool? ErrorIfExists ; + + /// + /// Client ID obtained after setting up your game with Sony. This one is associated with the modern marketplace, which + /// includes PS5, cross-generation for PS4, and unified entitlements. + /// + public string NextGenClientID ; + + /// + /// Client secret obtained after setting up your game with Sony. This one is associated with the modern marketplace, which + /// includes PS5, cross-generation for PS4, and unified entitlements. + /// + public string NextGenClientSecret ; + + } + + public class CreateOrUpdatePSNResponse : PlayFabResultCommon + { + } + + public class CreateOrUpdateSteamRequest : PlayFabRequestCommon + { + /// + /// Application ID obtained after setting up your app in Valve's developer portal. + /// + public string ApplicationId ; + + /// + /// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). + /// + public Dictionary CustomTags ; + + /// + /// Enforce usage of AzurePlayFab identity in user authentication tickets. + /// + public bool? EnforceServiceSpecificTickets ; + + /// + /// The optional entity to perform this action on. Defaults to the currently logged in entity. + /// + public EntityKey Entity ; + + /// + /// If an error should be returned if the addon already exists. + /// + public bool? ErrorIfExists ; + + /// + /// Sercet Key obtained after setting up your app in Valve's developer portal. + /// + public string SecretKey ; + + /// + /// Use Steam Payments sandbox endpoint for test transactions. + /// + public bool? UseSandbox ; + + } + + public class CreateOrUpdateSteamResponse : PlayFabResultCommon + { + } + + public class CreateOrUpdateTwitchRequest : PlayFabRequestCommon + { + /// + /// Client ID obtained after creating your Twitch developer account. + /// + public string ClientID ; + + /// + /// Client Secret obtained after creating your Twitch developer account. + /// + public string ClientSecret ; + + /// + /// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). + /// + public Dictionary CustomTags ; + + /// + /// The optional entity to perform this action on. Defaults to the currently logged in entity. + /// + public EntityKey Entity ; + + /// + /// If an error should be returned if the addon already exists. + /// + public bool? ErrorIfExists ; + + } + + public class CreateOrUpdateTwitchResponse : PlayFabResultCommon + { + } + + public class DeleteAppleRequest : PlayFabRequestCommon + { + /// + /// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). + /// + public Dictionary CustomTags ; + + /// + /// The optional entity to perform this action on. Defaults to the currently logged in entity. + /// + public EntityKey Entity ; + + } + + public class DeleteAppleResponse : PlayFabResultCommon + { + } + + public class DeleteFacebookInstantGamesRequest : PlayFabRequestCommon + { + /// + /// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). + /// + public Dictionary CustomTags ; + + /// + /// The optional entity to perform this action on. Defaults to the currently logged in entity. + /// + public EntityKey Entity ; + + } + + public class DeleteFacebookInstantGamesResponse : PlayFabResultCommon + { + } + + public class DeleteFacebookRequest : PlayFabRequestCommon + { + /// + /// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). + /// + public Dictionary CustomTags ; + + /// + /// The optional entity to perform this action on. Defaults to the currently logged in entity. + /// + public EntityKey Entity ; + + } + + public class DeleteFacebookResponse : PlayFabResultCommon + { + } + + public class DeleteGoogleRequest : PlayFabRequestCommon + { + /// + /// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). + /// + public Dictionary CustomTags ; + + /// + /// The optional entity to perform this action on. Defaults to the currently logged in entity. + /// + public EntityKey Entity ; + + } + + public class DeleteGoogleResponse : PlayFabResultCommon + { + } + + public class DeleteKongregateRequest : PlayFabRequestCommon + { + /// + /// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). + /// + public Dictionary CustomTags ; + + /// + /// The optional entity to perform this action on. Defaults to the currently logged in entity. + /// + public EntityKey Entity ; + + } + + public class DeleteKongregateResponse : PlayFabResultCommon + { + } + + public class DeleteNintendoRequest : PlayFabRequestCommon + { + /// + /// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). + /// + public Dictionary CustomTags ; + + /// + /// The optional entity to perform this action on. Defaults to the currently logged in entity. + /// + public EntityKey Entity ; + + } + + public class DeleteNintendoResponse : PlayFabResultCommon + { + } + + public class DeletePSNRequest : PlayFabRequestCommon + { + /// + /// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). + /// + public Dictionary CustomTags ; + + /// + /// The optional entity to perform this action on. Defaults to the currently logged in entity. + /// + public EntityKey Entity ; + + } + + public class DeletePSNResponse : PlayFabResultCommon + { + } + + public class DeleteSteamRequest : PlayFabRequestCommon + { + /// + /// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). + /// + public Dictionary CustomTags ; + + /// + /// The optional entity to perform this action on. Defaults to the currently logged in entity. + /// + public EntityKey Entity ; + + } + + public class DeleteSteamResponse : PlayFabResultCommon + { + } + + public class DeleteTwitchRequest : PlayFabRequestCommon + { + /// + /// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). + /// + public Dictionary CustomTags ; + + /// + /// The optional entity to perform this action on. Defaults to the currently logged in entity. + /// + public EntityKey Entity ; + + } + + public class DeleteTwitchResponse : PlayFabResultCommon + { + } + + /// + /// Combined entity type and ID structure which uniquely identifies a single entity. + /// + public class EntityKey + { + /// + /// Unique ID of the entity. + /// + public string Id { get; set; } + + /// + /// Entity type. See https://docs.microsoft.com/gaming/playfab/features/data/entities/available-built-in-entity-types + /// + public string Type { get; set; } + + } + + public class GetAppleRequest : PlayFabRequestCommon + { + /// + /// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). + /// + public Dictionary CustomTags ; + + /// + /// The optional entity to perform this action on. Defaults to the currently logged in entity. + /// + public EntityKey Entity ; + + } + + public class GetAppleResponse : PlayFabResultCommon + { + /// + /// iOS App Bundle ID obtained after setting up your app in the App Store. + /// + public string AppBundleId ; + + /// + /// Addon status. + /// + public bool Created ; + + /// + /// Ignore expiration date for identity tokens. + /// + public bool? IgnoreExpirationDate ; + + /// + /// Require secure authentication only for this app. + /// + public bool? RequireSecureAuthentication ; + + } + + public class GetFacebookInstantGamesRequest : PlayFabRequestCommon + { + /// + /// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). + /// + public Dictionary CustomTags ; + + /// + /// The optional entity to perform this action on. Defaults to the currently logged in entity. + /// + public EntityKey Entity ; + + } + + public class GetFacebookInstantGamesResponse : PlayFabResultCommon + { + /// + /// Facebook App ID obtained after setting up your app in Facebook Instant Games. + /// + public string AppID ; + + /// + /// Addon status. + /// + public bool Created ; + + } + + public class GetFacebookRequest : PlayFabRequestCommon + { + /// + /// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). + /// + public Dictionary CustomTags ; + + /// + /// The optional entity to perform this action on. Defaults to the currently logged in entity. + /// + public EntityKey Entity ; + + } + + public class GetFacebookResponse : PlayFabResultCommon + { + /// + /// Facebook App ID obtained after setting up your app in Facebook. + /// + public string AppID ; + + /// + /// Addon status. + /// + public bool Created ; + + /// + /// Email address for purchase dispute notifications. + /// + public string NotificationEmail ; + + } + + public class GetGoogleRequest : PlayFabRequestCommon + { + /// + /// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). + /// + public Dictionary CustomTags ; + + /// + /// The optional entity to perform this action on. Defaults to the currently logged in entity. + /// + public EntityKey Entity ; + + } + + public class GetGoogleResponse : PlayFabResultCommon + { + /// + /// Google App Package ID obtained after setting up your app in the Google Play developer portal. Required if using Google + /// receipt validation. + /// + public string AppPackageID ; + + /// + /// Addon status. + /// + public bool Created ; + + /// + /// Google OAuth Client ID obtained through the Google Developer Console by creating a new set of "OAuth Client ID". + /// Required if using Google Authentication. + /// + public string OAuthClientID ; + + } + + public class GetKongregateRequest : PlayFabRequestCommon + { + /// + /// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). + /// + public Dictionary CustomTags ; + + /// + /// The optional entity to perform this action on. Defaults to the currently logged in entity. + /// + public EntityKey Entity ; + + } + + public class GetKongregateResponse : PlayFabResultCommon + { + /// + /// Addon status. + /// + public bool Created ; + + } + + public class GetNintendoRequest : PlayFabRequestCommon + { + /// + /// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). + /// + public Dictionary CustomTags ; + + /// + /// The optional entity to perform this action on. Defaults to the currently logged in entity. + /// + public EntityKey Entity ; + + } + + public class GetNintendoResponse : PlayFabResultCommon + { + /// + /// Nintendo Switch Application ID, without the "0x" prefix. + /// + public string ApplicationID ; + + /// + /// Addon status. + /// + public bool Created ; + + /// + /// List of Nintendo Environments, currently supporting up to 4. + /// + public List Environments ; + + } + + public class GetPSNRequest : PlayFabRequestCommon + { + /// + /// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). + /// + public Dictionary CustomTags ; + + /// + /// The optional entity to perform this action on. Defaults to the currently logged in entity. + /// + public EntityKey Entity ; + + } + + public class GetPSNResponse : PlayFabResultCommon + { + /// + /// Client ID obtained after setting up your game with Sony. This one is associated with the existing PS4 marketplace. + /// + public string ClientID ; + + /// + /// Addon status. + /// + public bool Created ; + + /// + /// Client ID obtained after setting up your game with Sony. This one is associated with the modern marketplace, which + /// includes PS5, cross-generation for PS4, and unified entitlements. + /// + public string NextGenClientID ; + + } + + public class GetSteamRequest : PlayFabRequestCommon + { + /// + /// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). + /// + public Dictionary CustomTags ; + + /// + /// The optional entity to perform this action on. Defaults to the currently logged in entity. + /// + public EntityKey Entity ; + + } + + public class GetSteamResponse : PlayFabResultCommon + { + /// + /// Application ID obtained after setting up your game in Valve's developer portal. + /// + public string ApplicationId ; + + /// + /// Addon status. + /// + public bool Created ; + + /// + /// Enforce usage of AzurePlayFab identity in user authentication tickets. + /// + public bool? EnforceServiceSpecificTickets ; + + /// + /// Use Steam Payments sandbox endpoint for test transactions. + /// + public bool? UseSandbox ; + + } + + public class GetTwitchRequest : PlayFabRequestCommon + { + /// + /// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). + /// + public Dictionary CustomTags ; + + /// + /// The optional entity to perform this action on. Defaults to the currently logged in entity. + /// + public EntityKey Entity ; + + } + + public class GetTwitchResponse : PlayFabResultCommon + { + /// + /// Client ID obtained after creating your Twitch developer account. + /// + public string ClientID ; + + /// + /// Addon status. + /// + public bool Created ; + + } + + public class NintendoEnvironment + { + /// + /// Client ID for the Nintendo Environment. + /// + public string ClientID ; + + /// + /// Client Secret for the Nintendo Environment. + /// + public string ClientSecret ; + + /// + /// ID for the Nintendo Environment. + /// + public string ID ; + + } +} diff --git a/XamarinTestRunner/XamarinTestRunner/PlayFabSDK/PlayFabAdminModels.cs b/XamarinTestRunner/XamarinTestRunner/PlayFabSDK/PlayFabAdminModels.cs index 9b89e58b..12a6ad75 100644 --- a/XamarinTestRunner/XamarinTestRunner/PlayFabSDK/PlayFabAdminModels.cs +++ b/XamarinTestRunner/XamarinTestRunner/PlayFabSDK/PlayFabAdminModels.cs @@ -3081,6 +3081,12 @@ public enum GenericErrorCodes GameSaveManifestNotFound, GameSaveManifestVersionAlreadyExists, GameSaveConflictUpdatingManifest, + GameSaveManifestUpdatesNotAllowed, + GameSaveFileAlreadyExists, + GameSaveManifestVersionNotFinalized, + GameSaveUnknownFileInManifest, + GameSaveFileExceededReportedSize, + GameSaveFileNotUploaded, StateShareForbidden, StateShareTitleNotInFlight, StateShareStateNotFound, diff --git a/XamarinTestRunner/XamarinTestRunner/PlayFabSDK/PlayFabClientModels.cs b/XamarinTestRunner/XamarinTestRunner/PlayFabSDK/PlayFabClientModels.cs index d6944634..94f0a51a 100644 --- a/XamarinTestRunner/XamarinTestRunner/PlayFabSDK/PlayFabClientModels.cs +++ b/XamarinTestRunner/XamarinTestRunner/PlayFabSDK/PlayFabClientModels.cs @@ -2077,8 +2077,9 @@ public class GetFriendsListRequest : PlayFabRequestCommon /// /// If any additional services are queried for the user's friends, those friends who also have a PlayFab account registered /// for the title will be returned in the results. For Facebook, user has to have logged into the title's Facebook app - /// recently, and only friends who also plays this game will be included. For Xbox Live, user has to have logged into the - /// Xbox Live recently, and only friends who also play this game will be included. + /// recently, and only friends who also plays this game will be included. Note: If the user authenticated with + /// AuthenticationToken when calling LoginWithFacebook, instead of AcessToken, an empty list will be returned. For Xbox + /// Live, user has to have logged into the Xbox Live recently, and only friends who also play this game will be included. /// public class GetFriendsListResult : PlayFabResultCommon { @@ -4424,7 +4425,8 @@ public class LoginWithFacebookInstantGamesIdRequest : PlayFabRequestCommon /// 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. + /// the first Title ID. Note: If the user is authenticated with AuthenticationToken, instead of AccessToken, the + /// GetFriendsList API will return an empty list. /// public class LoginWithFacebookRequest : PlayFabRequestCommon { @@ -4433,6 +4435,11 @@ public class LoginWithFacebookRequest : PlayFabRequestCommon /// public string AccessToken ; + /// + /// Token used for limited login authentication. + /// + public string AuthenticationToken ; + /// /// Automatically create a PlayFab account if one is not currently linked to this ID. /// diff --git a/XamarinTestRunner/XamarinTestRunner/PlayFabSDK/PlayFabErrors.cs b/XamarinTestRunner/XamarinTestRunner/PlayFabSDK/PlayFabErrors.cs index 780309ee..dbe90053 100644 --- a/XamarinTestRunner/XamarinTestRunner/PlayFabSDK/PlayFabErrors.cs +++ b/XamarinTestRunner/XamarinTestRunner/PlayFabSDK/PlayFabErrors.cs @@ -863,6 +863,12 @@ public enum PlayFabErrorCode GameSaveManifestNotFound = 20300, GameSaveManifestVersionAlreadyExists = 20301, GameSaveConflictUpdatingManifest = 20302, + GameSaveManifestUpdatesNotAllowed = 20303, + GameSaveFileAlreadyExists = 20304, + GameSaveManifestVersionNotFinalized = 20305, + GameSaveUnknownFileInManifest = 20306, + GameSaveFileExceededReportedSize = 20307, + GameSaveFileNotUploaded = 20308, StateShareForbidden = 21000, StateShareTitleNotInFlight = 21001, StateShareStateNotFound = 21002, diff --git a/XamarinTestRunner/XamarinTestRunner/PlayFabSDK/PlayFabLeaderboardsAPI.cs b/XamarinTestRunner/XamarinTestRunner/PlayFabSDK/PlayFabProgressionAPI.cs similarity index 99% rename from XamarinTestRunner/XamarinTestRunner/PlayFabSDK/PlayFabLeaderboardsAPI.cs rename to XamarinTestRunner/XamarinTestRunner/PlayFabSDK/PlayFabProgressionAPI.cs index e4cc5a02..761d6e35 100644 --- a/XamarinTestRunner/XamarinTestRunner/PlayFabSDK/PlayFabLeaderboardsAPI.cs +++ b/XamarinTestRunner/XamarinTestRunner/PlayFabSDK/PlayFabProgressionAPI.cs @@ -1,6 +1,6 @@ #if !DISABLE_PLAYFABENTITY_API && !DISABLE_PLAYFAB_STATIC_API -using PlayFab.LeaderboardsModels; +using PlayFab.ProgressionModels; using PlayFab.Internal; #pragma warning disable 0649 using System; @@ -13,9 +13,9 @@ namespace PlayFab { /// - /// Manage entity statistics Manage entity statistics + /// Manage entity statistics Manage entity leaderboards /// - public static class PlayFabLeaderboardsAPI + public static class PlayFabProgressionAPI { /// /// Verify entity login. diff --git a/XamarinTestRunner/XamarinTestRunner/PlayFabSDK/PlayFabLeaderboardsInstanceAPI.cs b/XamarinTestRunner/XamarinTestRunner/PlayFabSDK/PlayFabProgressionInstanceAPI.cs similarity index 99% rename from XamarinTestRunner/XamarinTestRunner/PlayFabSDK/PlayFabLeaderboardsInstanceAPI.cs rename to XamarinTestRunner/XamarinTestRunner/PlayFabSDK/PlayFabProgressionInstanceAPI.cs index 653896cb..67fafcb3 100644 --- a/XamarinTestRunner/XamarinTestRunner/PlayFabSDK/PlayFabLeaderboardsInstanceAPI.cs +++ b/XamarinTestRunner/XamarinTestRunner/PlayFabSDK/PlayFabProgressionInstanceAPI.cs @@ -1,6 +1,6 @@ #if !DISABLE_PLAYFABENTITY_API -using PlayFab.LeaderboardsModels; +using PlayFab.ProgressionModels; using PlayFab.Internal; #pragma warning disable 0649 using System; @@ -13,21 +13,21 @@ namespace PlayFab { /// - /// Manage entity statistics Manage entity statistics + /// Manage entity statistics Manage entity leaderboards /// - public class PlayFabLeaderboardsInstanceAPI + public class PlayFabProgressionInstanceAPI { public readonly PlayFabApiSettings apiSettings = null; public readonly PlayFabAuthenticationContext authenticationContext = null; - public PlayFabLeaderboardsInstanceAPI(PlayFabAuthenticationContext context) + public PlayFabProgressionInstanceAPI(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 PlayFabLeaderboardsInstanceAPI(PlayFabApiSettings settings, PlayFabAuthenticationContext context) + public PlayFabProgressionInstanceAPI(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"); diff --git a/PlayFabSDK/source/PlayFabLeaderboardsModels.cs b/XamarinTestRunner/XamarinTestRunner/PlayFabSDK/PlayFabProgressionModels.cs similarity index 99% rename from PlayFabSDK/source/PlayFabLeaderboardsModels.cs rename to XamarinTestRunner/XamarinTestRunner/PlayFabSDK/PlayFabProgressionModels.cs index bfe7ad91..afd3cf76 100644 --- a/PlayFabSDK/source/PlayFabLeaderboardsModels.cs +++ b/XamarinTestRunner/XamarinTestRunner/PlayFabSDK/PlayFabProgressionModels.cs @@ -2,7 +2,7 @@ using System; using System.Collections.Generic; -namespace PlayFab.LeaderboardsModels +namespace PlayFab.ProgressionModels { public class CreateLeaderboardDefinitionRequest : PlayFabRequestCommon { diff --git a/XamarinTestRunner/XamarinTestRunner/PlayFabSDK/PlayFabSDK.csproj b/XamarinTestRunner/XamarinTestRunner/PlayFabSDK/PlayFabSDK.csproj index de070f16..d1b960ee 100644 --- a/XamarinTestRunner/XamarinTestRunner/PlayFabSDK/PlayFabSDK.csproj +++ b/XamarinTestRunner/XamarinTestRunner/PlayFabSDK/PlayFabSDK.csproj @@ -8,7 +8,7 @@ 512 PlayFabAllSDK - 1.185.240802 + 1.187.240816 PlayFab CSharp Sdk Microsoft Microsoft @@ -21,7 +21,7 @@ PlayFab PlayFabSDK PlayFab, Baas, Paas, JSON, REST, HTTP, SSL, API, cloud, liveops, game, gamedev, native - https://docs.microsoft.com/gaming/playfab/release-notes#240802 + https://docs.microsoft.com/gaming/playfab/release-notes#240816 en 1 1 diff --git a/XamarinTestRunner/XamarinTestRunner/PlayFabSDK/PlayFabServerModels.cs b/XamarinTestRunner/XamarinTestRunner/PlayFabSDK/PlayFabServerModels.cs index c12e42ab..dafd3814 100644 --- a/XamarinTestRunner/XamarinTestRunner/PlayFabSDK/PlayFabServerModels.cs +++ b/XamarinTestRunner/XamarinTestRunner/PlayFabSDK/PlayFabServerModels.cs @@ -2401,6 +2401,12 @@ public enum GenericErrorCodes GameSaveManifestNotFound, GameSaveManifestVersionAlreadyExists, GameSaveConflictUpdatingManifest, + GameSaveManifestUpdatesNotAllowed, + GameSaveFileAlreadyExists, + GameSaveManifestVersionNotFinalized, + GameSaveUnknownFileInManifest, + GameSaveFileExceededReportedSize, + GameSaveFileNotUploaded, StateShareForbidden, StateShareTitleNotInFlight, StateShareStateNotFound, diff --git a/XamarinTestRunner/XamarinTestRunner/PlayFabSDK/PlayFabSettings.cs b/XamarinTestRunner/XamarinTestRunner/PlayFabSDK/PlayFabSettings.cs index e57ca1a3..d1e06460 100644 --- a/XamarinTestRunner/XamarinTestRunner/PlayFabSDK/PlayFabSettings.cs +++ b/XamarinTestRunner/XamarinTestRunner/PlayFabSDK/PlayFabSettings.cs @@ -6,9 +6,9 @@ namespace PlayFab { public class PlayFabSettings { - public const string SdkVersion = "1.185.240802"; - public const string BuildIdentifier = "adobuild_csharpsdk_114"; - public const string SdkVersionString = "CSharpSDK-1.185.240802"; + public const string SdkVersion = "1.187.240816"; + public const string BuildIdentifier = "adobuild_csharpsdk_118"; + public const string SdkVersionString = "CSharpSDK-1.187.240816"; /// This is only for customers running a private cluster. Generally you shouldn't touch this public static string DefaultProductionEnvironmentUrl = "playfabapi.com";