<commit_before>package org.entitypedia.games.gameframework.client;

import com.fasterxml.jackson.core.type.TypeReference;
import org.entitypedia.games.common.client.WordGameClient;
import org.entitypedia.games.common.model.ResultsPage;
import org.entitypedia.games.gameframework.common.api.IClueAPI;
import org.entitypedia.games.gameframework.common.api.IPlayerAPI;
import org.entitypedia.games.gameframework.common.api.IWordAPI;
import org.entitypedia.games.gameframework.common.model.Clue;
import org.entitypedia.games.gameframework.common.model.Player;
import org.entitypedia.games.gameframework.common.model.Word;

/**
 * @author <a rel="author" href="http://autayeu.com/"><NAME></a>
 */
public class GameFrameworkClient extends WordGameClient implements IGameFrameworkClient {

    private static final TypeReference<Player> PLAYER_TYPE_REFERENCE = new TypeReference<Player>() {
    };
    private static final TypeReference<ResultsPage<Player>> PLAYERS_RP_TYPE_REFERENCE = new TypeReference<ResultsPage<Player>>() {
    };
    private static final TypeReference<Clue> CLUE_TYPE_REFERENCE = new TypeReference<Clue>() {
    };
    private static final TypeReference<Word> WORD_TYPE_REFERENCE = new TypeReference<Word>() {
    };
    private static final TypeReference<ResultsPage<Word>> WORDS_RP_TYPE_REFERENCE = new TypeReference<ResultsPage<Word>>() {
    };
    private static final TypeReference<ResultsPage<Clue>> CLUES_RP_TYPE_REFERENCE = new TypeReference<ResultsPage<Clue>>() {
    };

    private static final String DEFAULT_API_ENDPOINT = "http://localhost:9632/gameframework/webapi/";
    private static final String SECURE_API_ENDPOINT = "https://localhost:9633/gameframework/webapi/";


    public GameFrameworkClient(String uid, String password) {
        super(DEFAULT_API_ENDPOINT, uid, password);
    }

    public GameFrameworkClient(String uid, String password, Boolean secure) {
        super(SECURE_API_ENDPOINT, uid, password);
    }

    public GameFrameworkClient(String uid, String password, String token, String tokenSecret) {
        super(DEFAULT_API_ENDPOINT, uid, password, token, tokenSecret);
    }

    public GameFrameworkClient(String uid, String password, String token, String tokenSecret, Boolean secure) {
        super(SECURE_API_ENDPOINT, uid, password, token, tokenSecret);
    }

    @Override
    public void login() {
        doEmptyGet(apiEndpoint + IPlayerAPI.LOGIN_PLAYER);
    }

    @Override
    public Player loginFacebook(String token) {
        return doSimpleGet(apiEndpoint + IPlayerAPI.LOGIN_FACEBOOK_PLAYER + "?token=" + token, PLAYER_TYPE_REFERENCE);
    }

    @Override
    public void activateEmail(String code) {
        doSimplePost(apiEndpoint + IPlayerAPI.ACTIVATE_PLAYER_EMAIL + "?code=" + code);
    }

    @Override
    public void sendEmailActivationCode() {
        doSimplePost(apiEndpoint + IPlayerAPI.SEND_EMAIL_ACTIVATION_CODE);
    }

    @Override
    public Player createPlayer(Player player) {
        return doPostReadObject(apiEndpoint + IPlayerAPI.CREATE_PLAYER, player, PLAYER_TYPE_REFERENCE);
    }

    @Override
    public Player readPlayer(String playerID) {
        return doSimpleGet(apiEndpoint + IPlayerAPI.READ_PLAYER.replaceAll("\\{.*\\}", playerID), PLAYER_TYPE_REFERENCE);
    }

    @Override
    public Player readPlayer(long playerID) {
        return doSimpleGet(apiEndpoint + IPlayerAPI.READ_PLAYER.replaceAll("\\{.*\\}", Long.toString(playerID)), PLAYER_TYPE_REFERENCE);
    }

    @Override
    public void deletePlayer(long playerID) {
        doSimplePost(apiEndpoint + IPlayerAPI.DELETE_PLAYER + "?playerID=" + Long.toString(playerID));
    }

    @Override
    public void updatePlayer(Player player) {
        doPostObject(apiEndpoint + IPlayerAPI.UPDATE_PLAYER, player);
    }<commit_msg> #123 email password reset<commit_after>package org.entitypedia.games.gameframework.client;

import com.fasterxml.jackson.core.type.TypeReference;
import org.entitypedia.games.common.client.WordGameClient;
import org.entitypedia.games.common.model.ResultsPage;
import org.entitypedia.games.gameframework.common.api.IClueAPI;
import org.entitypedia.games.gameframework.common.api.IPlayerAPI;
import org.entitypedia.games.gameframework.common.api.IWordAPI;
import org.entitypedia.games.gameframework.common.model.Clue;
import org.entitypedia.games.gameframework.common.model.Player;
import org.entitypedia.games.gameframework.common.model.Word;

/**
 * @author <a rel="author" href="http://autayeu.com/"><NAME></a>
 */
public class GameFrameworkClient extends WordGameClient implements IGameFrameworkClient {

    private static final TypeReference<Player> PLAYER_TYPE_REFERENCE = new TypeReference<Player>() {
    };
    private static final TypeReference<ResultsPage<Player>> PLAYERS_RP_TYPE_REFERENCE = new TypeReference<ResultsPage<Player>>() {
    };
    private static final TypeReference<Clue> CLUE_TYPE_REFERENCE = new TypeReference<Clue>() {
    };
    private static final TypeReference<Word> WORD_TYPE_REFERENCE = new TypeReference<Word>() {
    };
    private static final TypeReference<ResultsPage<Word>> WORDS_RP_TYPE_REFERENCE = new TypeReference<ResultsPage<Word>>() {
    };
    private static final TypeReference<ResultsPage<Clue>> CLUES_RP_TYPE_REFERENCE = new TypeReference<ResultsPage<Clue>>() {
    };

    private static final String DEFAULT_API_ENDPOINT = "http://localhost:9632/gameframework/webapi/";
    private static final String SECURE_API_ENDPOINT = "https://localhost:9633/gameframework/webapi/";


    public GameFrameworkClient(String uid, String password) {
        super(DEFAULT_API_ENDPOINT, uid, password);
    }

    public GameFrameworkClient(String uid, String password, Boolean secure) {
        super(SECURE_API_ENDPOINT, uid, password);
    }

    public GameFrameworkClient(String uid, String password, String token, String tokenSecret) {
        super(DEFAULT_API_ENDPOINT, uid, password, token, tokenSecret);
    }

    public GameFrameworkClient(String uid, String password, String token, String tokenSecret, Boolean secure) {
        super(SECURE_API_ENDPOINT, uid, password, token, tokenSecret);
    }

    @Override
    public void login() {
        doEmptyGet(apiEndpoint + IPlayerAPI.LOGIN_PLAYER);
    }

    @Override
    public Player loginFacebook(String token) {
        return doSimpleGet(apiEndpoint + IPlayerAPI.LOGIN_FACEBOOK_PLAYER + "?token=" + token, PLAYER_TYPE_REFERENCE);
    }

    @Override
    public void activateEmail(String code) {
        doSimplePost(apiEndpoint + IPlayerAPI.ACTIVATE_PLAYER_EMAIL + "?code=" + code);
    }

    @Override
    public void sendEmailActivationCode() {
        doSimplePost(apiEndpoint + IPlayerAPI.SEND_EMAIL_ACTIVATION_CODE);
    }

    @Override
    public void resetPassword(String code, String password) {
        doSimplePost(apiEndpoint + IPlayerAPI.RESET_PLAYER_PASSWORD + "?code=" + code + "&password=" + encodeURL(password));
    }

    @Override
    public void requestPasswordReset(String email) {
        doSimplePost(apiEndpoint + IPlayerAPI.REQUEST_PLAYER_PASSWORD_RESET + "?email=" + encodeURL(email));
    }

    @Override
    public Player createPlayer(Player player) {
        return doPostReadObject(apiEndpoint + IPlayerAPI.CREATE_PLAYER, player, PLAYER_TYPE_REFERENCE);
    }

    @Override
    public Player readPlayer(String playerID) {
        return doSimpleGet(apiEndpoint + IPlayerAPI.READ_PLAYER.replaceAll("\\{.*\\}", playerID), PLAYER_TYPE_REFERENCE);
    }

    @Override
    public Player readPlayer(long playerID) {
        return doSimpleGet(apiEndpoint + IPlayerAPI.READ_PLAYER.replaceAll("\\{.*\\}", Long.toString(playerID)), PLAYER_TYPE_REFERENCE);
    }

    @Override
    public void deletePlayer(long playerID) {
        doSimplePost(apiEndpoint + IPlayerAPI.DELETE_PLAYER + "?playerID=" + Long.toString(playerID));
    }

    @Override
    public void updatePlayer(Player player) {
        doPostObject(apiEndpoint + IPlayerAPI.UPDATE_PLAYER, player);
    }
{'fraction_non_alphanumeric': 0.10197450637340665, 'fraction_numerical': 0.0023744063984004, 'mean_word_length': 4.462798634812287, 'pattern_counts': {'":': 0, '<': 45, '<?xml version=': 0, '>': 45, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4673530', 'n_tokens_mistral': 2404, 'n_tokens_neox': 2316, 'n_words': 450}