All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.dahuatech.icc.alarm.model.v202208.operate.AlarmHostsOperatePostRequest 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 java.util.List;

/**
 * program:java-sdk
 *
 * @Author: 355079
 * @Date:2022-08-18 09:41
 * @Description: 报警主机操作控制(用于处理资源绑定数据)
 */
public class AlarmHostsOperatePostRequest extends AbstractIccRequest {
    ListnodeInfoList;
    private Integer operate;
    private Double delayTime;
    public class NodeInfo{
        private String nodeCode;
        private String nodeName;

        public String getNodeCode() {
            return nodeCode;
        }

        public void setNodeCode(String nodeCode) {
            this.nodeCode = nodeCode;
        }

        public String getNodeName() {
            return nodeName;
        }

        public void setNodeName(String nodeName) {
            this.nodeName = nodeName;
        }
    }

    public List getNodeInfoList() {
        return nodeInfoList;
    }

    public void setNodeInfoList(List nodeInfoList) {
        putBodyParameter("nodeInfoList",nodeInfoList);
        this.nodeInfoList = nodeInfoList;
    }

    public Integer getOperate() {
        return operate;
    }

    public void setOperate(Integer operate) {
        putBodyParameter("operate",operate);
        this.operate = operate;
    }

    public Double getDelayTime() {
        return delayTime;
    }

    public void setDelayTime(Double delayTime) {
        putBodyParameter("delayTime",delayTime);
        this.delayTime = delayTime;
    }

    public AlarmHostsOperatePostRequest() throws ClientException {
        super(AlarmConstant.url(AlarmConstant.ALARM_HOSTS_OPERATE_POST), Method.POST);
    }

    public AlarmHostsOperatePostRequest(HttpConfigInfo httpConfigInfo, String url, Method method) throws ClientException {
        super(httpConfigInfo.getPrefixUrl() + url, method, Boolean.TRUE);
    }

    @Override
    public Class getResponseClass() {
        return AlarmHostsOperatePostResponse.class;
    }

    public void businessValid() {
        if (nodeInfoList==null) {
            throw new BusinessException(ParamValidEnum.PARAM_NOT_EMPTY_ERROR.getCode(), ParamValidEnum.PARAM_NOT_EMPTY_ERROR.getErrMsg(), "nodeInfoList");
        }
        if (operate==null) {
            throw new BusinessException(ParamValidEnum.PARAM_NOT_EMPTY_ERROR.getCode(), ParamValidEnum.PARAM_NOT_EMPTY_ERROR.getErrMsg(), "operate");
        }
        if (delayTime==null) {
            throw new BusinessException(ParamValidEnum.PARAM_NOT_EMPTY_ERROR.getCode(), ParamValidEnum.PARAM_NOT_EMPTY_ERROR.getErrMsg(), "delayTime");
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy