package com.atlassian.bitbucket.repository.ref.restriction;

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

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

/**
 * A restriction on a {@link MinimalRef} or a group of refs.
 */
public interface RefRestriction {

    /**
     * @return all the {@link AccessGrant access grants} associated with this restriction
     */
    @Nonnull
    List<AccessGrant> getAccessGrants();

    /**
     * @return the restriction's ID
     */
    int getId();

    /**
     * @return the restriction's {@link RefRestrictionType type}
     */
    @Nonnull
    RefRestrictionType getType();

    /**
     * @return the id for the {@link Repository#getId repository ID} the restriction
     * targets
     */
    int getRepositoryId();

    /**
     * @return the {@link RefMatcher matcher} that will apply to the restriction
     */
    @Nonnull
    RefMatcher getMatcher();
}
