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

io.github.sornerol.chess.pubapi.client.StreamersClient Maven / Gradle / Ivy

There is a newer version: 1.7.0
Show newest version
package io.github.sornerol.chess.pubapi.client;

import io.github.sornerol.chess.pubapi.domain.streamers.StreamersList;
import io.github.sornerol.chess.pubapi.exception.ChessComPubApiException;

import java.io.IOException;

/**
 * Client for fetching data about streamers.
 *
 * @see Chess.com PubAPI documentation
 */
public class StreamersClient extends PubApiClientBase {
    private static final String ENDPOINT_BASE = "https://api.chess.com/pub/streamers";

    /**
     * Fetch information about Twitch streamers on Chess.com.
     *
     * @return {@link StreamersList} with information about streamers.
     * @throws IOException             if there is a problem connecting to Chess.com.
     * @throws ChessComPubApiException if Chess.com returns a non-success response code.
     * @see Chess.com PubAPI documentation
     */
    public StreamersList getStreamers() throws IOException, ChessComPubApiException {
        return getRequest(ENDPOINT_BASE, StreamersList.class);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy