/// <summary> /// Gets the moderation state for an item, including the concern category and string reason. /// </summary> public void GetItemModerationState(GetItemModerationStateRequest request, Action <GetItemModerationStateResponse> resultCallback, Action <PlayFabError> errorCallback, object customData = null, Dictionary <string, string> extraHeaders = null) { var context = (request == null ? null : request.AuthenticationContext) ?? authenticationContext; var callSettings = apiSettings ?? PlayFabSettings.staticSettings; if (!context.IsEntityLoggedIn()) { throw new PlayFabException(PlayFabExceptionCode.NotLoggedIn, "Must be logged in to call this method"); } PlayFabHttp.MakeApiCall("/Catalog/GetItemModerationState", request, AuthType.EntityToken, resultCallback, errorCallback, customData, extraHeaders, context, callSettings, this); }
/// <summary> /// Gets the moderation state for an item, including the concern category and string reason. /// </summary> public static async Task <PlayFabResult <GetItemModerationStateResponse> > GetItemModerationStateAsync(GetItemModerationStateRequest request, object customData = null, Dictionary <string, string> 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("/Catalog/GetItemModerationState", request, "X-EntityToken", requestContext.EntityToken, extraHeaders); if (httpResult is PlayFabError) { var error = (PlayFabError)httpResult; PlayFabSettings.GlobalErrorHandler?.Invoke(error); return(new PlayFabResult <GetItemModerationStateResponse> { Error = error, CustomData = customData }); } var resultRawJson = (string)httpResult; var resultData = PluginManager.GetPlugin <ISerializerPlugin>(PluginContract.PlayFab_Serializer).DeserializeObject <PlayFabJsonSuccess <GetItemModerationStateResponse> >(resultRawJson); var result = resultData.data; return(new PlayFabResult <GetItemModerationStateResponse> { Result = result, CustomData = customData }); }