import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
/**
* v0.1 DRAFT. The Java snippets, run against the sandbox (Java 17+).
*
*
* export BORROU_BASE_URL=https://api.borrou.capital
* export BORROU_CLIENT_ID=bpc_test_... # your sandbox credential
* export BORROU_CLIENT_SECRET=... # from your secret store, never from a file you commit
* javac -d out *.java && java -cp out Quickstart
*
*
*
Reads your products, a quote, the first page of your events and every one of your loans, and
* submits one application for a synthetic borrower: an idempotent POST, sent twice with the same key
* to show the replay. Writes run with a sandbox credential only.
*/
public final class Quickstart {
private Quickstart() {}
public static void main(String[] args) throws Exception {
String clientId = required("BORROU_CLIENT_ID");
String baseUrl = System.getenv().getOrDefault("BORROU_BASE_URL", "https://api.borrou.capital");
BorrouClient client = new BorrouClient(baseUrl, clientId, required("BORROU_CLIENT_SECRET"));
try {
run(client, clientId);
} catch (BorrouClient.ApiError e) {
System.err.println(e.getMessage() + " (request " + e.requestId + ")");
System.exit(1);
}
}
private static void run(BorrouClient client, String clientId) throws Exception {
List