<commit_before>package com.instasent;

import okhttp3.*;
import org.json.simple.JSONValue;

import java.io.StringWriter;
import java.util.HashMap;
import java.util.Map;

public class InstasentClient {

    private String rootEndpoint = "http://api.instasent.codes";
    private String secureChannel = "http://api.instasent.codes";
    private String token;
    private boolean userSecureChannel = true;

    public InstasentClient(String token, boolean useSecureChannel) {
        this.token = token;
        this.userSecureChannel = useSecureChannel;
    }

    public Map<String, String> sendSms(String from, String to, String text) {
        String url;

        if (this.userSecureChannel)
            url = this.secureChannel + "/sms/";
        else
            url = this.rootEndpoint + "/sms/";

        String httpMethod = "POST";

        Map<String, String> data = new HashMap<String, String>();
        data.put("from", from);
        data.put("to", to);
        data.put("text", text);

        return this.execRequest(url, httpMethod, data);
    }

    public Map<String, String> getSms(int page, int per_page) {

        String url;

        if (this.userSecureChannel)
            url = this.secureChannel + "/sms/?" + "page=" + page + "&per_page=" + per_page;
        else
            url = this.rootEndpoint + "/sms/?" + "page=" + page + "&per_page=" + per_page;

        String httpMethod = "GET";

        Map<String, String> data = new HashMap<String, String>();

        return this.execRequest(url, httpMethod, data);
    }

    public Map<String, String> getSmsById(String id) {

        String url;

        if (this.userSecureChannel)
            url = this.secureChannel + "/sms/" + id;
        else
            url = this.rootEndpoint + "/sms/" + id;

        String httpMethod = "GET";

        Map<String, String> data = new HashMap<String, String>();<commit_msg>Only secure channel<commit_after>package com.instasent;

import okhttp3.*;
import org.json.simple.JSONValue;

import java.io.StringWriter;
import java.util.HashMap;
import java.util.Map;

public class InstasentClient {

    private String secureChannel = "https://api.instasent.codes";
    private String token;

    public InstasentClient(String token) {
        this.token = token;
    }

    public Map<String, String> sendSms(String from, String to, String text) {
        String url;

        url = this.secureChannel + "/sms/";

        String httpMethod = "POST";

        Map<String, String> data = new HashMap<String, String>();
        data.put("from", from);
        data.put("to", to);
        data.put("text", text);

        return this.execRequest(url, httpMethod, data);
    }

    public Map<String, String> getSms(int page, int per_page) {

        String url;

        url = this.secureChannel + "/sms/?" + "page=" + page + "&per_page=" + per_page;

        String httpMethod = "GET";

        Map<String, String> data = new HashMap<String, String>();

        return this.execRequest(url, httpMethod, data);
    }

    public Map<String, String> getSmsById(String id) {

        String url;

        url = this.secureChannel + "/sms/" + id;

        String httpMethod = "GET";

        Map<String, String> data = new HashMap<String, String>();
{'fraction_non_alphanumeric': 0.12749615975422426, 'fraction_numerical': 0.0006144393241167435, 'mean_word_length': 2.566265060240964, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 1, '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': '4217521', 'n_tokens_mistral': 990, 'n_tokens_neox': 955, 'n_words': 254}