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

com.vk.api.sdk.queries.photos.PhotosRestoreQuery Maven / Gradle / Ivy

package com.vk.api.sdk.queries.photos;

import com.vk.api.sdk.client.AbstractQueryBuilder;
import com.vk.api.sdk.client.VkApiClient;
import com.vk.api.sdk.client.actors.UserActor;
import com.vk.api.sdk.objects.base.responses.OkResponse;
import java.util.Arrays;
import java.util.List;

/**
 * Query for Photos.restore method
 */
public class PhotosRestoreQuery 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 photoId value of "photo id" parameter. Minimum is 0.
     */
    public PhotosRestoreQuery(VkApiClient client, UserActor actor, int photoId) {
        super(client, "photos.restore", OkResponse.class);
        accessToken(actor.getAccessToken());
        photoId(photoId);
    }

    /**
     * ID of the user or community that owns the photo.
     *
     * @param value value of "owner id" parameter.
     * @return a reference to this {@code AbstractQueryBuilder} object to fulfill the "Builder" pattern.
     */
    public PhotosRestoreQuery ownerId(Integer value) {
        return unsafeParam("owner_id", value);
    }

    /**
     * Photo ID.
     *
     * @param value value of "photo id" parameter. Minimum is 0.
     * @return a reference to this {@code AbstractQueryBuilder} object to fulfill the "Builder" pattern.
     */
    protected PhotosRestoreQuery photoId(int value) {
        return unsafeParam("photo_id", value);
    }

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy