using HotChocolate.Types;
using System.Threading.Tasks;
using WotBlitzStatisticsPro.Common.Model;
using WotBlitzStatisticsPro.WgApiClient;
namespace WotBlitzStatisticsPro.GraphQl.Mutation
{
[ExtendObjectType(Name = "Mutation")]
public class WargamingAuthMutation
{
private readonly IWargamingAuthenticationClient _wargamingAuthenticationClient;
public WargamingAuthMutation(IWargamingAuthenticationClient wargamingAuthenticationClient)
{
_wargamingAuthenticationClient = wargamingAuthenticationClient;
}
///
/// Prolongates Wargaming authentication token
///
/// Wargaming realm
/// Old token to prolongate
///
public Task ProlongAuthToken(RealmType realm, string oldToken)
{
return _wargamingAuthenticationClient.ProlongAuthToken(realm, oldToken);
}
///
/// Removes player's access token
///
/// Wargaming realm
/// Token to logout
/// Operation result
public async Task Logout(RealmType realm, string token)
{
await _wargamingAuthenticationClient.Logout(realm, token);
return "OK";
}
///
/// Removes player's acoount history from database
///
/// Wargaming realm
/// Player Id
/// Operation result
public Task RemovePlayerHistory(RealmType realm, long accountId)
{
return Task.FromResult("Metod is not implemented yet.");
}
}
}