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

com.github.twitch4j.graphql.command.CommandUnfollowUser 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.UnfollowMutation;
import com.github.twitch4j.graphql.internal.type.UnfollowUserInput;

/**
 * Unfollow User
 */
public class CommandUnfollowUser extends BaseCommand {

    private final Long targetUserId;

    public CommandUnfollowUser(ApolloClient apolloClient, Long targetUserId) {
        super(apolloClient);
        this.targetUserId = targetUserId;
    }

    @Override
    protected ApolloCall getGraphQLCall() {
        ApolloCall apolloCall = apolloClient.mutate(
            UnfollowMutation.builder()
                .unfollowUserInput(
                    UnfollowUserInput.builder()
                        .targetID(targetUserId.toString())
                        .build()
                )
                .build()
        );

        return apolloCall;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy