class DynamoSchema {

    public DynamoIndex getTableIndex() {
        return getIndexes().stream()
                .filter(index -> index.getIndexType().equals(IndexType.TABLE))
                .findFirst().orElseThrow(() -> new IllegalStateException("expected there to always be a table 'index'"));
    }

}