com.dahuatech.icc.alarm.model.v202208.operate.AlarmHostsOperateGetRequest Maven / Gradle / Ivy
package com.dahuatech.icc.alarm.model.v202208.operate;
import com.dahuatech.hutool.http.Method;
import com.dahuatech.icc.alarm.Constant.AlarmConstant;
import com.dahuatech.icc.common.ParamValidEnum;
import com.dahuatech.icc.exception.ClientException;
import com.dahuatech.icc.oauth.exception.BusinessException;
import com.dahuatech.icc.oauth.http.AbstractIccRequest;
import com.dahuatech.icc.oauth.model.v202010.HttpConfigInfo;
import com.dahuatech.icc.util.StringUtils;
/**
* program:java-sdk
*
* @Author: 355079
* @Date:2022-08-18 09:41
* @Description: 报警主机操作控制
*/
public class AlarmHostsOperateGetRequest extends AbstractIccRequest {
private String nodeCode;
private Integer operate;
public String getNodeCode() {
return nodeCode;
}
public void setNodeCode(String nodeCode) {
this.nodeCode = nodeCode;
}
public Integer getOperate() {
return operate;
}
public void setOperate(Integer operate) {
this.operate = operate;
}
public AlarmHostsOperateGetRequest() throws ClientException {
super(AlarmConstant.url(AlarmConstant.ALARM_HOSTS_OPERATE_GET), Method.GET);
}
public AlarmHostsOperateGetRequest(HttpConfigInfo httpConfigInfo, String url, Method method) throws ClientException {
super(httpConfigInfo.getPrefixUrl() + url, method, Boolean.TRUE);
}
@Override
public Class getResponseClass() {
return AlarmHostsOperateGetResponse.class;
}
public void businessValid() {
if (StringUtils.isEmpty(nodeCode)) {
throw new BusinessException(ParamValidEnum.PARAM_NOT_EMPTY_ERROR.getCode(), ParamValidEnum.PARAM_NOT_EMPTY_ERROR.getErrMsg(), "nodeCode");
}
if (operate==null) {
throw new BusinessException(ParamValidEnum.PARAM_NOT_EMPTY_ERROR.getCode(), ParamValidEnum.PARAM_NOT_EMPTY_ERROR.getErrMsg(), "operate");
}
}
}