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

com.vk.api.sdk.queries.execute.ExecuteCodeQuery Maven / Gradle / Ivy

Go to download

Java library for VK API interaction, includes OAuth 2.0 authorization and API methods.

There is a newer version: 1.0.16
Show newest version
package com.vk.api.sdk.queries.execute;

import com.google.gson.JsonElement;
import com.vk.api.sdk.client.AbstractQueryBuilder;
import com.vk.api.sdk.client.VkApiClient;
import com.vk.api.sdk.client.actors.GroupActor;
import com.vk.api.sdk.client.actors.UserActor;
import com.vk.api.sdk.client.actors.ServiceActor;

import java.util.Arrays;
import java.util.List;

/**
 * Query for execute by code
 */
public class ExecuteCodeQuery extends AbstractQueryBuilder {

    /**
     * Creates a AbstractQueryBuilder instance that can be used to build api request with various parameters
     *
     * @param client VK API client
     * @param actor  actor with access token
     * @param code   value of "code" parameter
     */
    public ExecuteCodeQuery(VkApiClient client, UserActor actor, String code) {
        super(client, "execute", JsonElement.class);
        accessToken(actor.getAccessToken());
        code(code);
    }

    /**
     * Creates a AbstractQueryBuilder instance that can be used to build api request with various parameters
     *
     * @param client VK API client
     * @param actor  actor with access token
     * @param code   value of "code" parameter
     */
    public ExecuteCodeQuery(VkApiClient client, GroupActor actor, String code) {
        super(client, "execute", JsonElement.class);
        accessToken(actor.getAccessToken());
        code(code);
    }

    /**
     * Code
     *
     * @param value value of "code" parameter. Minimum is 0.
     * @return a reference to this {@code AbstractQueryBuilder} object to fulfill the "Builder" pattern.
     */
    protected ExecuteCodeQuery code(String value) {
        return unsafeParam("code", value);
    }

    @Override
    protected ExecuteCodeQuery getThis() {
        return this;
    }

    @Override
    protected List essentialKeys() {
        return Arrays.asList("code", "access_token");
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy