package com.atlassian.bitbucket.event.hook;


import com.atlassian.event.api.AsynchronousPreferred;
import com.atlassian.bitbucket.event.annotation.TransactionAware;
import com.atlassian.bitbucket.repository.Repository;
import com.atlassian.bitbucket.setting.Settings;

import javax.annotation.Nonnull;

/**
 * Fired when a repository hook's settings are changed.
 * <p>
 * This event is internally audited with a MEDIUM priority.
 */
@AsynchronousPreferred
@TransactionAware
public class RepositoryHookSettingsChangedEvent extends RepositoryHookEvent {

    private final Settings settings;

    public RepositoryHookSettingsChangedEvent(@Nonnull Object source, @Nonnull Repository repository, @Nonnull String hook, @Nonnull Settings settings) {
        super(source, repository, hook);
        this.settings = settings;
    }

    @Nonnull
    public Settings getSettings() {
        return settings;
    }
}
