import PagedDataProvider from 'bitbucket/internal/impl/data-provider/paged';

import validator from '../json-validation/json-validation';
import models from '../models/models';

export default class RefDataProvider extends PagedDataProvider {
    constructor(options, ...args) {
        options.jsonDescriptor = [models.ref];
        options.filterDescriptor = {
            term: 'string?',
            repository: models.repository,
            type: validator.asEnum('RefType', models.RefType),
        };
        super(options, ...args);
    }
}
