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

com.github.twitch4j.graphql.command.CommandLockPrediction 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.LockPredictionEventMutation;
import com.github.twitch4j.graphql.internal.type.LockPredictionEventInput;
import lombok.NonNull;

public class CommandLockPrediction extends BaseCommand {
    private final String predictionEventId;

    /**
     * Constructor
     *
     * @param apolloClient      Apollo Client
     * @param predictionEventId ID of the prediction to be locked
     */
    public CommandLockPrediction(@NonNull ApolloClient apolloClient, @NonNull String predictionEventId) {
        super(apolloClient);
        this.predictionEventId = predictionEventId;
    }

    @Override
    protected ApolloCall getGraphQLCall() {
        return apolloClient.mutate(
            LockPredictionEventMutation.builder()
                .input(LockPredictionEventInput.builder().id(predictionEventId).build())
                .build()
        );
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy