<commit_before>package com.github.stachu540.hirezapi.api.rest;

import com.github.stachu540.hirezapi.api.Authentication;
import org.springframework.web.client.RestTemplate;

public class RestClient {

    private final RestTemplate rest = new RestTemplate();
    private final Authentication authentication;

    { rest.setErrorHandler(new RestErrorHandler()); }

    public RestClient(Authentication authentication) {this.authentication = authentication;}

    public <O extends Object> O request(String endpoint, Class<O> model, String... args) {
        String url = authentication.getUrl(endpoint, args);
        authentication.getLogger().debug("Request for endpoint url: {}", url);
        return rest.getForObject(url, model);<commit_msg>moved to constructor<commit_after>package com.github.stachu540.hirezapi.api.rest;

import com.github.stachu540.hirezapi.api.Authentication;
import org.springframework.web.client.RestTemplate;

public class RestClient {

    private final RestTemplate rest = new RestTemplate();
    private final Authentication authentication;

    public RestClient(Authentication authentication) {
        this.authentication = authentication;
        this.rest.setErrorHandler(new RestErrorHandler());
    }

    public <O extends Object> O request(String endpoint, Class<O> model, String... args) {
        String url = authentication.getUrl(endpoint, args);
        authentication.getLogger().debug("Request for endpoint url: {}", url);
        return rest.getForObject(url, model);
{'fraction_non_alphanumeric': 0.100990099009901, 'fraction_numerical': 0.007920792079207921, 'mean_word_length': 4.472924187725631, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3021021', 'n_tokens_mistral': 398, 'n_tokens_neox': 386, 'n_words': 99}