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;

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

    @ApiModelProperty(name = "appLockApplication", value = "AppLockApplication.", required = true)
    private AppLockApplication appLockApplication;

    @Override
    public void validateRequest() throws ProfileConfigurationException {

        if (appLockApplication == null) {
            throw new ProfileConfigurationException("AppLockApplication is empty");
        }

        if (StringUtils.isEmpty(appLockApplication.getIdentifier())) {
            throw new ProfileConfigurationException("Identifier is empty");
        }
    }

    public AppLockApplication getAppLockApplication() {
        return appLockApplication;
    }

    public void setAppLockApplication(AppLockApplication appLockApplication) {
        this.appLockApplication = appLockApplication;
    }
}
