com.dahuatech.icc.assesscontrol.model.v202103.channelControl.ChannelControlStayCloseRequest Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of java-sdk-accesscontrol Show documentation
Show all versions of java-sdk-accesscontrol Show documentation
Dahua ICC Open API SDK for Java
package com.dahuatech.icc.assesscontrol.model.v202103.channelControl;
import com.dahuatech.hutool.http.Method;
import com.dahuatech.icc.assesscontrol.constant.AccessControlConstant;
import com.dahuatech.icc.assesscontrol.constant.ParamConstant;
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.util.CollectionUtil;
import java.util.List;
/**
* 门通道控制常闭
*
* @author 237417
*/
public class ChannelControlStayCloseRequest extends AbstractIccRequest {
/** 门通道编码 */
private List channelCodeList;
public ChannelControlStayCloseRequest(Builder builder) throws ClientException {
super(AccessControlConstant.url(AccessControlConstant.ASSESS_CONTROL_URL_STAY_OPEN_POST), Method.POST);
this.channelCodeList = builder.channelCodeList;
putBodyParameter("channelCodeList",channelCodeList);
}
public ChannelControlStayCloseRequest(){
super(AccessControlConstant.url(AccessControlConstant.ASSESS_CONTROL_URL_STAY_OPEN_POST), Method.POST);
}
public static Builder builder() {
return new Builder();
}
@Override
public Class getResponseClass() {
return ChannelControlStayCloseResponse.class;
}
public List getChannelCodeList() {
return channelCodeList;
}
public void setChannelCodeList(List channelCodeList) {
this.channelCodeList = channelCodeList;
putBodyParameter("channelCodeList",channelCodeList);
}
public static class Builder {
/** 门通道编码 */
private List channelCodeList;
public Builder channelCodeList(List channelCodeList) {
this.channelCodeList = channelCodeList;
return this;
}
public ChannelControlStayCloseRequest build() throws ClientException {
return new ChannelControlStayCloseRequest(this);
}
}
public void businessValid() {
if(CollectionUtil.isEmpty(channelCodeList)){
throw new BusinessException(ParamValidEnum.PARAM_NOT_EMPTY_ERROR.getCode(), ParamValidEnum.PARAM_NOT_EMPTY_ERROR.getErrMsg(), "channelCodeList");
}
}
}