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

com.github.twitch4j.graphql.command.CommandFetchActivePredictions Maven / Gradle / Ivy

The newest version!
package com.github.twitch4j.graphql.command;

import com.apollographql.apollo.ApolloCall;
import com.apollographql.apollo.ApolloClient;
import com.github.twitch4j.graphql.internal.FetchActivePredictionsQuery;
import lombok.NonNull;

public class CommandFetchActivePredictions extends BaseCommand {
    private final String channelId;

    /**
     * Constructor
     *
     * @param apolloClient Apollo Client
     * @param channelId    The id of the channel to fetch active predictions of
     */
    public CommandFetchActivePredictions(@NonNull ApolloClient apolloClient, @NonNull String channelId) {
        super(apolloClient);
        this.channelId = channelId;
    }

    @Override
    protected ApolloCall getGraphQLCall() {
        return apolloClient.query(
            FetchActivePredictionsQuery.builder()
                .channelId(channelId)
                .build()
        );
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy