All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.gocardless.http.WebhookParser Maven / Gradle / Ivy

There is a newer version: 6.0.0
Show newest version
package com.gocardless.http;

import com.gocardless.resources.Event;
import com.google.common.collect.ImmutableList;
import com.google.gson.*;
import com.google.gson.reflect.TypeToken;
import java.util.List;

public final class WebhookParser {
    private WebhookParser() {}

    public static ImmutableList parse(String responseBody) {
        Gson gson = GsonFactory.build();
        ResponseParser responseParser = new ResponseParser(gson);
        return responseParser.parseMultiple(responseBody, "events",
                new TypeToken>() {});
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy