content: package allbegray.slack.webapi.method.channels;
  
  import java.util.List;
  import java.util.Map;
  
  import allbegray.slack.validation.Problem;
  import allbegray.slack.validation.ValidationError;
  import allbegray.slack.webapi.SlackWebApiConstants;
  import allbegray.slack.webapi.method.AbstractMethod;
  
  public class ChannelInviteMethod extends AbstractMethod {
  
  	public ChannelInviteMethod(String channel, String user) {
  		this.channel = channel;
  		this.user = user;
  	}
  
  	protected String channel;
  	protected String user;
  
  	public String getChannel() {
  		return channel;
  	}
  
  	public void setChannel(String channel) {
  		this.channel = channel;
  	}
  
  	public String getUser() {
  		return user;
  	}
  
  	public void setUser(String user) {
  		this.user = user;
  	}
  
  	@Override
  	public String getMethodName() {
  		return SlackWebApiConstants.CHANNELS_INVITE;
  	}
  
  	@Override
  	public void validate(List<ValidationError> errors) {
  		if (channel == null) {
  			addError(errors, "channel", Problem.REQUIRED);
  		}
  		if (user == null) {
  			addError(errors, "user", Problem.REQUIRED);
  		}
  	}
  
  	@Override
  	protected void createParameters(Map<String, String> parameters) {
  		parameters.put("channel", channel);
  		parameters.put("user", user);
  	}
  
  }
  