/// <summary> /// Sets the profiles access policy /// </summary> public static void SetProfilePolicy(SetEntityProfilePolicyRequest request, Action <SetEntityProfilePolicyResponse> resultCallback, Action <PlayFabError> errorCallback, object customData = null, Dictionary <string, string> extraHeaders = null) { var context = (request == null ? null : request.AuthenticationContext) ?? PlayFabSettings.staticPlayer; PlayFabHttp.MakeApiCall("/Profile/SetProfilePolicy", request, AuthType.EntityToken, resultCallback, errorCallback, customData, extraHeaders, context); }
/// <summary> /// Sets the profiles access policy /// </summary> public void SetProfilePolicy(SetEntityProfilePolicyRequest request, Action <SetEntityProfilePolicyResponse> 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("/Profile/SetProfilePolicy", request, AuthType.EntityToken, resultCallback, errorCallback, customData, extraHeaders, context, callSettings, this); }
/// <summary> /// Sets the profiles access policy /// </summary> /// <param name="Entity">The entity to perform this action on. (Required)</param> /// <param name="Statements">The statements to include in the access policy. (Optional)</param> public static Task <SetEntityProfilePolicyResponse> SetProfilePolicy(EntityKey Entity, List <EntityPermissionStatement> Statements = default, PlayFabAuthenticationContext customAuthContext = null, object customData = null, Dictionary <string, string> extraHeaders = null) { SetEntityProfilePolicyRequest request = new SetEntityProfilePolicyRequest() { Entity = Entity, Statements = Statements, }; var context = GetContext(customAuthContext); return(PlayFabHttp.MakeApiCallAsync <SetEntityProfilePolicyResponse>("/Profile/SetProfilePolicy", request, AuthType.EntityToken, customData, extraHeaders, context)); }
/// <summary> /// Sets the profiles access policy /// </summary> public void SetProfilePolicy(SetEntityProfilePolicyRequest request, Action <SetEntityProfilePolicyResponse> resultCallback, Action <PlayFabError> errorCallback, object customData = null, Dictionary <string, string> extraHeaders = null) { PlayFabHttp.MakeApiCall("/Profile/SetProfilePolicy", request, AuthType.EntityToken, resultCallback, errorCallback, customData, extraHeaders, false, authenticationContext, ApiSettings); }
/// <summary> /// Sets the profiles access policy /// </summary> public static async Task <PlayFabResult <SetEntityProfilePolicyResponse> > SetProfilePolicyAsync(SetEntityProfilePolicyRequest request, object customData = null, Dictionary <string, string> extraHeaders = null) { if ((request?.AuthenticationContext?.EntityToken ?? PlayFabSettings.staticPlayer.EntityToken) == null) { throw new PlayFabException(PlayFabExceptionCode.EntityTokenNotSet, "Must call GetEntityToken before calling this method"); } var httpResult = await PlayFabHttp.DoPost("/Profile/SetProfilePolicy", request, "X-EntityToken", PlayFabSettings.staticPlayer.EntityToken, extraHeaders); if (httpResult is PlayFabError) { var error = (PlayFabError)httpResult; PlayFabSettings.GlobalErrorHandler?.Invoke(error); return(new PlayFabResult <SetEntityProfilePolicyResponse> { Error = error, CustomData = customData }); } var resultRawJson = (string)httpResult; var resultData = PluginManager.GetPlugin <ISerializerPlugin>(PluginContract.PlayFab_Serializer).DeserializeObject <PlayFabJsonSuccess <SetEntityProfilePolicyResponse> >(resultRawJson); var result = resultData.data; return(new PlayFabResult <SetEntityProfilePolicyResponse> { Result = result, CustomData = customData }); }