package com.atlassian.bitbucket.internal.importer;

import com.atlassian.httpclient.api.Response;

import javax.annotation.Nonnull;
import java.util.function.Function;

/**
 * A helper class to executes http requests.
 */
public interface ExternalRequestExecutor {

    @Nonnull
    <T> T executeGetRequest(@Nonnull Credential credential,
                            @Nonnull String url,
                            @Nonnull Function<Response, T> parser);

    @Nonnull
    <T> T executeHeadRequest(@Nonnull Credential credential,
                            @Nonnull String url,
                            @Nonnull Function<Response, T> parser);
}
