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

com.github.twitch4j.graphql.command.CommandCreatePrediction 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.CreatePredictionEventMutation;
import com.github.twitch4j.graphql.internal.type.CreatePredictionEventInput;
import lombok.NonNull;

public class CommandCreatePrediction extends BaseCommand {
    private final CreatePredictionEventInput input;

    /**
     * Constructor
     *
     * @param apolloClient Apollo Client
     * @param input        Inputs for creating a new prediction
     */
    public CommandCreatePrediction(@NonNull ApolloClient apolloClient, @NonNull CreatePredictionEventInput input) {
        super(apolloClient);
        this.input = input;
    }

    @Override
    protected ApolloCall getGraphQLCall() {
        return apolloClient.mutate(
            CreatePredictionEventMutation.builder()
                .input(input)
                .build()
        );
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy