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

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

import java.util.List;

@ApiModel(value = "AppToPerAppVPNMapping",
        description = "This class represents the information of AppToPerAppVPN.")
public class AppToPerAppVPNMapping extends PayloadOperation {

    @ApiModelProperty(name = "appLayerVPNMappings", value = "List of App Layer VPN.", required = true)
    private List<AppLayerVPNMapping> appLayerVPNMappings;

    public List<AppLayerVPNMapping> getAppLayerVPNMappings() {
        return appLayerVPNMappings;
    }

    public void setAppLayerVPNMappings(List<AppLayerVPNMapping> appLayerVPNMappings) {
        this.appLayerVPNMappings = appLayerVPNMappings;
    }

    @Override
    public void validateRequest() throws ProfileConfigurationException {

        if (appLayerVPNMappings == null) {
            throw new ProfileConfigurationException("App layer VPN mapping is empty");
        }
    }
}
