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

import com.vk.api.sdk.client.AbstractQueryBuilder;
import com.vk.api.sdk.client.VkApiClient;
import com.vk.api.sdk.client.actors.Actor;
import com.vk.api.sdk.objects.docs.Doc;

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

/**
 * Query for Docs.save method
 */
public class DocsSaveQuery extends AbstractQueryBuilder<DocsSaveQuery, Doc> {
    /**
     * 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 file   value of "file" parameter.
     */
    public DocsSaveQuery(VkApiClient client, Actor actor, String file) {
        super(client, "docs.save", Doc.class);
        accessToken(actor.getAccessToken());
        file(file);
    }

    /**
     * This parameter is returned when the file is uploaded to the server.
     *
     * @param value value of "file" parameter.
     * @return a reference to this {@code AbstractQueryBuilder} object to fulfill the "Builder" pattern.
     */
    protected DocsSaveQuery file(String value) {
        return unsafeParam("file", value);
    }

    /**
     * Document title.
     *
     * @param value value of "title" parameter.
     * @return a reference to this {@code AbstractQueryBuilder} object to fulfill the "Builder" pattern.
     */
    public DocsSaveQuery title(String value) {
        return unsafeParam("title", value);
    }

    /**
     * Document tags.
     *
     * @param value value of "tags" parameter.
     * @return a reference to this {@code AbstractQueryBuilder} object to fulfill the "Builder" pattern.
     */
    public DocsSaveQuery tags(String value) {
        return unsafeParam("tags", value);
    }

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

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

@@ -82,16 +82,52 @@
 uilder;%0A
+import com.vk.api.sdk.client.Utils;%0A
 import c
@@ -406,12 +406,18 @@
 ry, 
+List%3C
 Doc%3E
+%3E
  %7B%0A 
@@ -782,16 +782,56 @@
 s.save%22,
+ Utils.buildParametrizedType(List.class,
  Doc.cla
@@ -833,16 +833,17 @@
 c.class)
+)
 ;%0A      

Fix response in DocsSaveQuery class