/// <summary> /// Changes the role membership of a list of entities from one role to another. /// </summary> public async Task <PlayFabResult <EmptyResponse> > ChangeMemberRoleAsync(ChangeMemberRoleRequest request, object customData = null, Dictionary <string, string> extraHeaders = null) { var requestSettings = apiSettings ?? PlayFabSettings.staticSettings; if ((request?.AuthenticationContext?.EntityToken ?? authenticationContext.EntityToken) == null) { throw new PlayFabException(PlayFabExceptionCode.EntityTokenNotSet, "Must call GetEntityToken before calling this method"); } var httpResult = await PlayFabHttp.DoPost("/Group/ChangeMemberRole", request, "X-EntityToken", authenticationContext.EntityToken, extraHeaders, requestSettings); if (httpResult is PlayFabError) { var error = (PlayFabError)httpResult; PlayFabSettings.GlobalErrorHandler?.Invoke(error); return(new PlayFabResult <EmptyResponse> { Error = error, CustomData = customData }); } var resultRawJson = (string)httpResult; var resultData = PluginManager.GetPlugin <ISerializerPlugin>(PluginContract.PlayFab_Serializer).DeserializeObject <PlayFabJsonSuccess <EmptyResponse> >(resultRawJson); var result = resultData.data; return(new PlayFabResult <EmptyResponse> { Result = result, CustomData = customData }); }
/// <summary> /// Changes the role membership of a list of entities from one role to another. /// </summary> public static void ChangeMemberRole(ChangeMemberRoleRequest request, Action <EmptyResponse> resultCallback, Action <PlayFabError> errorCallback, object customData = null, Dictionary <string, string> extraHeaders = null) { var context = (request == null ? null : request.AuthenticationContext) ?? PlayFabSettings.staticPlayer; PlayFabHttp.MakeApiCall("/Group/ChangeMemberRole", request, AuthType.EntityToken, resultCallback, errorCallback, customData, extraHeaders, context); }
/// <summary> /// Changes the role membership of a list of entities from one role to another. /// </summary> public void ChangeMemberRole(ChangeMemberRoleRequest request, Action <EmptyResponse> 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("/Group/ChangeMemberRole", request, AuthType.EntityToken, resultCallback, errorCallback, customData, extraHeaders, context, callSettings, this); }
/// <summary> /// Changes the role membership of a list of entities from one role to another. /// </summary> /// <param name="DestinationRoleId">The ID of the role that the entities will become a member of. This must be an existing role. Role IDs must be between 1 and 64 characters long. (Optional)</param> /// <param name="Group">The identifier of the group (Required)</param> /// <param name="Members">List of entities to move between roles in the group. All entities in this list must be members of the group and origin role. (Required)</param> /// <param name="OriginRoleId">The ID of the role that the entities currently are a member of. Role IDs must be between 1 and 64 characters long. (Required)</param> public static Task <EmptyResponse> ChangeMemberRole(EntityKey Group, List <EntityKey> Members, string OriginRoleId, string DestinationRoleId = default, PlayFabAuthenticationContext customAuthContext = null, object customData = null, Dictionary <string, string> extraHeaders = null) { ChangeMemberRoleRequest request = new ChangeMemberRoleRequest() { Group = Group, Members = Members, OriginRoleId = OriginRoleId, DestinationRoleId = DestinationRoleId, }; var context = GetContext(customAuthContext); return(PlayFabHttp.MakeApiCallAsync <EmptyResponse>("/Group/ChangeMemberRole", request, AuthType.EntityToken, customData, extraHeaders, context)); }
/// <summary> /// Changes the role membership of a list of entities from one role to another. /// </summary> public static void ChangeMemberRole(ChangeMemberRoleRequest request, Action <EmptyResponse> resultCallback, Action <PlayFabError> errorCallback, object customData = null, Dictionary <string, string> extraHeaders = null) { PlayFabHttp.MakeApiCall("/Group/ChangeMemberRole", request, AuthType.EntityToken, resultCallback, errorCallback, customData, extraHeaders); }