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.GroupActor;
import com.vk.api.sdk.client.actors.UserActor;
import com.vk.api.sdk.objects.photos.responses.SaveOwnerPhotoResponse;

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

/**
 * Query for Photos.saveOwnerCoverPhoto method
 */
public class PhotosSaveOwnerCoverPhotoQuery extends AbstractQueryBuilder<PhotosSaveOwnerCoverPhotoQuery, SaveOwnerPhotoResponse> {

    /**
     * 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
     */
    public PhotosSaveOwnerCoverPhotoQuery(VkApiClient client, UserActor actor, String photo, String hash) {
        super(client, "photos.saveOwnerCoverPhoto", SaveOwnerPhotoResponse.class);
        accessToken(actor.getAccessToken());
        photo(photo);
        hash(hash);
    }

    /**
     * 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
     */
    public PhotosSaveOwnerCoverPhotoQuery(VkApiClient client, GroupActor actor, String photo, String hash) {
        super(client, "photos.saveOwnerCoverPhoto", SaveOwnerPhotoResponse.class);
        accessToken(actor.getAccessToken());
        photo(photo);
        hash(hash);
    }

    /**
     * Parameter returned after photo upload.
     *
     * @param value value of "hash" parameter.
     * @return a reference to this {@code AbstractQueryBuilder} object to fulfill the "Builder" pattern.
     */
    protected PhotosSaveOwnerCoverPhotoQuery hash(String value) {
        return unsafeParam("hash", value);
    }

    /**
     * Parameter returned after photo upload.
     *
     * @param value value of "photo" parameter.
     * @return a reference to this {@code AbstractQueryBuilder} object to fulfill the "Builder" pattern.
     */
    protected PhotosSaveOwnerCoverPhotoQuery photo(String value) {
        return unsafeParam("photo", value);
    }

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

    @Override
    protected List<String> essentialKeys() {
        return Arrays.asList("access_token", "photo", "hash");
    }
}

@@ -84,16 +84,52 @@
 uilder;%0A
+import com.vk.api.sdk.client.Utils;%0A
 import c
@@ -162,16 +162,16 @@
 Client;%0A
-
 import c
@@ -291,46 +291,17 @@
 cts.
-photos.responses.SaveOwnerPhotoRespons
+base.Imag
 e;%0A%0A
@@ -509,38 +509,27 @@
 oQuery, 
-SaveOwnerPhotoResponse
+List%3CImage%3E
 %3E %7B%0A%0A   
@@ -901,37 +901,60 @@
 o%22, 
-SaveOwnerPhotoRespons
+Utils.buildParametrizedType(List.class, Imag
 e.class)
 ;%0A  
@@ -941,32 +941,33 @@
 ss, Image.class)
+)
 ;%0A        access
@@ -1423,37 +1423,60 @@
 o%22, 
-SaveOwnerPhotoRespons
+Utils.buildParametrizedType(List.class, Imag
 e.class)
 ;%0A  
@@ -1471,16 +1471,17 @@
 e.class)
+)
 ;%0A      

Fix response for PhotosSaveOwnerCoverPhotoQuery