package org.wso2.carbon.device.mgt.ios.payload.beans;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang.StringUtils;
import org.wso2.carbon.device.mgt.ios.payload.exception.ProfileConfigurationException;

import java.util.List;

@ApiModel(value = "PerAppVPN",
        description = "This class represents the information related to PerAppVPN.")
public class PerAppVPN extends PayloadOperation {

    @ApiModelProperty(name = "VPNUUID", value = "VPNUUID.", required = true)
    private String VPNUUID;
    @ApiModelProperty(name = "safariDomains", value = "Safari domains.", required = true)
    private List<String> safariDomains;
    @ApiModelProperty(name = "onDemandMatchAppEnabled", value = "Enable/Disable OnDemandMatch App Enable.", required = true)
    private Boolean onDemandMatchAppEnabled;

    @Override
    public void validateRequest() throws ProfileConfigurationException {

        if (StringUtils.isEmpty(VPNUUID)) {
            throw new ProfileConfigurationException("VPN UUID is empty");
        }

        if (onDemandMatchAppEnabled == null) {
            throw new ProfileConfigurationException("onDemandMatchAppEnabled flag is empty");
        }
    }

    public String getVPNUUID() {
        return VPNUUID;
    }

    public void setVPNUUID(String VPNUUID) {
        this.VPNUUID = VPNUUID;
    }

    public List<String> getSafariDomains() {
        return safariDomains;
    }

    public void setSafariDomains(List<String> safariDomains) {
        this.safariDomains = safariDomains;
    }

    public Boolean getOnDemandMatchAppEnabled() {
        return onDemandMatchAppEnabled;
    }

    public void setOnDemandMatchAppEnabled(Boolean onDemandMatchAppEnabled) {
        this.onDemandMatchAppEnabled = onDemandMatchAppEnabled;
    }
}
