// Path: heroku-api/src/main/java/com/heroku/api/request/Request.java
// public interface Request<T> {
// 
// 
//     /**
//      * HTTP method. e.g. GET, POST, PUT, DELETE
//      * @return The HTTP method used in the request.
//      */
//     Http.Method getHttpMethod();
// 
//     /**
//      * Path and query parameters of a URL.
//      * @return The path and query parameters as a String.
//      */
//     String getEndpoint();
// 
//     /**
//      * Whether or not the request has a body.
//      * @return true if it has a request body, otherwise false
//      */
//     boolean hasBody();
// 
//     /**
//      * Value of the request body.
//      * @return Body
//      * @throws UnsupportedOperationException Generally thrown if {@link #hasBody()} returns false
//      */
//     String getBody();
// 
//     /**
//      * Value of the request body as a Map.
//      * @return Body
//      * @throws UnsupportedOperationException Generally thrown if {@link #hasBody()} returns false
//      */
//     Map<String, ?> getBodyAsMap();
// 
//     /**
//      * HTTP Accept header.
//      * @return The Accept header to be used in the request. Typically "application/json" or "text/xml"
//      * @see com.heroku.api.http.Http.Accept
//      */
//     Http.Accept getResponseType();
// 
//     /**
//      * {@link Map} of request-specific HTTP headers.
//      * @return Name/value pairs of HTTP headers.
//      */
//     Map<String, String> getHeaders();
// 
//     /**
//      * Response handler.
//      * @param bytes Data returned from the request.
//      * @param status HTTP status code.
//      * @return The type {@link T} as specified by an individual request.
//      * @throws com.heroku.api.exception.RequestFailedException Generally thrown when the HTTP status code is 4XX.
//      */
//     T getResponse(byte[] bytes, int status, Map<String,String> headers);
// 
// }


import com.heroku.api.request.Request;
import java.util.Map;
package com.heroku.api.connection;



/**
 * Asynchronous version of Connection
 *
 * @param <F> the type of 'Future' that this connection will return
 */
public interface AsyncConnection<F> extends Connection {


    /**
     * Asynchronously execute the given request with, using a different apiKey than the one associated with this connection
     *
     * @param request The request to execute
     * @param apiKey API key for Heroku
     * @param <T>     The Type of the Response when parsed by the request, returned by the Future
     * @return A future Response
     */

    <T> F executeAsync(Request<T> request, String apiKey);


    /**
     * Asynchronously execute the given request with, using a different apiKey than the one associated with this connection
     *
     * @param request The request to execute
     * @param apiKey API key for Heroku
     * @param <T>     The Type of the Response when parsed by the request, returned by the Future
     * @param extraHeaders any extra headers to send with the request
     * @return A future Response
     */

// Path: heroku-api/src/main/java/com/heroku/api/request/Request.java
// public interface Request<T> {
// 
// 
//     /**
//      * HTTP method. e.g. GET, POST, PUT, DELETE
//      * @return The HTTP method used in the request.
//      */
//     Http.Method getHttpMethod();
// 
//     /**
//      * Path and query parameters of a URL.
//      * @return The path and query parameters as a String.
//      */
//     String getEndpoint();
// 
//     /**
//      * Whether or not the request has a body.
//      * @return true if it has a request body, otherwise false
//      */
//     boolean hasBody();
// 
//     /**
//      * Value of the request body.
//      * @return Body
//      * @throws UnsupportedOperationException Generally thrown if {@link #hasBody()} returns false
//      */
//     String getBody();
// 
//     /**
//      * Value of the request body as a Map.
//      * @return Body
//      * @throws UnsupportedOperationException Generally thrown if {@link #hasBody()} returns false
//      */
//     Map<String, ?> getBodyAsMap();
// 
//     /**
//      * HTTP Accept header.
//      * @return The Accept header to be used in the request. Typically "application/json" or "text/xml"
//      * @see com.heroku.api.http.Http.Accept
//      */
//     Http.Accept getResponseType();
// 
//     /**
//      * {@link Map} of request-specific HTTP headers.
//      * @return Name/value pairs of HTTP headers.
//      */
//     Map<String, String> getHeaders();
// 
//     /**
//      * Response handler.
//      * @param bytes Data returned from the request.
//      * @param status HTTP status code.
//      * @return The type {@link T} as specified by an individual request.
//      * @throws com.heroku.api.exception.RequestFailedException Generally thrown when the HTTP status code is 4XX.
//      */
//     T getResponse(byte[] bytes, int status, Map<String,String> headers);
// 
// }


// Path: heroku-api/src/main/java/com/heroku/api/connection/AsyncConnection.java
import com.heroku.api.request.Request;
import java.util.Map;

package com.heroku.api.connection;



/**
 * Asynchronous version of Connection
 *
 * @param <F> the type of 'Future' that this connection will return
 */
public interface AsyncConnection<F> extends Connection {


    /**
     * Asynchronously execute the given request with, using a different apiKey than the one associated with this connection
     *
     * @param request The request to execute
     * @param apiKey API key for Heroku
     * @param <T>     The Type of the Response when parsed by the request, returned by the Future
     * @return A future Response
     */

    <T> F executeAsync(Request<T> request, String apiKey);


    /**
     * Asynchronously execute the given request with, using a different apiKey than the one associated with this connection
     *
     * @param request The request to execute
     * @param apiKey API key for Heroku
     * @param <T>     The Type of the Response when parsed by the request, returned by the Future
     * @param extraHeaders any extra headers to send with the request
     * @return A future Response
     */

    <T> F executeAsync(Request<T> request, Map<String,String> extraHeaders, String apiKey);