package com.atlassian.bitbucket.internal.importer.event;

import com.atlassian.analytics.api.annotations.EventName;
import com.atlassian.bitbucket.internal.importer.ExternalRequestExecutor;
import com.atlassian.event.api.AsynchronousPreferred;

import javax.annotation.Nonnull;

/**
 * Event that is raised when a {@link ExternalRequestExecutor#executeGetRequest} fails due to the response being forbidden.
 * This typically means that the given credentials do not have the required permissions to import repositories
 * The {@link com.atlassian.httpclient.api.Response#getStatusCode()},
 * {@link com.atlassian.httpclient.api.Response#getStatusText()}, and url that the request was made to is provided.
 */
@AsynchronousPreferred
@EventName("stash.importer.request.forbidden")
public class ExternalRequestForbiddenEvent extends ExternalRequestFailedEvent {
    public ExternalRequestForbiddenEvent(@Nonnull Object source,
                                         int statusCode) {
        super(source, statusCode);
    }
}
