package com.atlassian.bitbucket.hook;

import com.atlassian.bitbucket.repository.RefChange;
import com.atlassian.bitbucket.repository.Repository;

import javax.annotation.Nonnull;
import java.util.Collection;

/**
 * Hook that is called just <b>after</b> a push request is completed.
 */
public interface PostReceiveHook {

    /**
     * Callback method that is called just after a push request is completed. This hook executes during the processing
     * of a push and the client will have to wait during the execution of the {@code onReceive} method.
     * 
     * @param repository the repository that was pushed to
     * @param refChanges the refs that have just been updated
     * @param response used to write to the client's stdout and/or stderr
     */
    void onReceive(@Nonnull Repository repository, @Nonnull Collection<RefChange> refChanges, @Nonnull HookResponse response);
}
