// Path: src/main/java/org/graylog/plugins/aggregates/rule/rest/models/requests/AddRuleRequest.java
// @AutoValue
// @JsonAutoDetect
// public abstract class AddRuleRequest {
// 	
//     @JsonProperty("rule")
//     @NotNull
//     public abstract RuleImpl getRule();
//     
//     @JsonCreator    
//     public static AddRuleRequest create(//@JsonProperty("name") @Valid String name,
//     		@JsonProperty("rule") @Valid RuleImpl rule
// 
//     		) {
//         return new AutoValue_AddRuleRequest(rule);
//     }
// }
// 
// Path: src/main/java/org/graylog/plugins/aggregates/rule/rest/models/requests/UpdateRuleRequest.java
// @AutoValue
// @JsonAutoDetect
// public abstract class UpdateRuleRequest {
// 	
// 
//     @JsonProperty("rule")
//     @NotNull
//     public abstract RuleImpl getRule();
//     
//     @JsonCreator    
//     public static UpdateRuleRequest create(
//     		@JsonProperty("rule") @Valid RuleImpl rule    		    		
//     		) {
//         return new AutoValue_UpdateRuleRequest(rule);
//     }
// }


import java.io.UnsupportedEncodingException;
import java.util.List;
import org.graylog.plugins.aggregates.rule.rest.models.requests.AddRuleRequest;
import org.graylog.plugins.aggregates.rule.rest.models.requests.UpdateRuleRequest;
import com.mongodb.MongoException;
package org.graylog.plugins.aggregates.rule;




public interface RuleService {
    long count();

    Rule update(String name, Rule rule);

    Rule create(Rule rule);
    
    List<Rule> all();
    
    int destroy(String ruleName) throws MongoException, UnsupportedEncodingException;

	Rule fromRequest(AddRuleRequest request);
	
// Path: src/main/java/org/graylog/plugins/aggregates/rule/rest/models/requests/AddRuleRequest.java
// @AutoValue
// @JsonAutoDetect
// public abstract class AddRuleRequest {
// 	
//     @JsonProperty("rule")
//     @NotNull
//     public abstract RuleImpl getRule();
//     
//     @JsonCreator    
//     public static AddRuleRequest create(//@JsonProperty("name") @Valid String name,
//     		@JsonProperty("rule") @Valid RuleImpl rule
// 
//     		) {
//         return new AutoValue_AddRuleRequest(rule);
//     }
// }
// 
// Path: src/main/java/org/graylog/plugins/aggregates/rule/rest/models/requests/UpdateRuleRequest.java
// @AutoValue
// @JsonAutoDetect
// public abstract class UpdateRuleRequest {
// 	
// 
//     @JsonProperty("rule")
//     @NotNull
//     public abstract RuleImpl getRule();
//     
//     @JsonCreator    
//     public static UpdateRuleRequest create(
//     		@JsonProperty("rule") @Valid RuleImpl rule    		    		
//     		) {
//         return new AutoValue_UpdateRuleRequest(rule);
//     }
// }


// Path: src/main/java/org/graylog/plugins/aggregates/rule/RuleService.java
import java.io.UnsupportedEncodingException;
import java.util.List;
import org.graylog.plugins.aggregates.rule.rest.models.requests.AddRuleRequest;
import org.graylog.plugins.aggregates.rule.rest.models.requests.UpdateRuleRequest;
import com.mongodb.MongoException;

package org.graylog.plugins.aggregates.rule;




public interface RuleService {
    long count();

    Rule update(String name, Rule rule);

    Rule create(Rule rule);
    
    List<Rule> all();
    
    int destroy(String ruleName) throws MongoException, UnsupportedEncodingException;

	Rule fromRequest(AddRuleRequest request);
	
	Rule fromRequest(UpdateRuleRequest request);