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;

@ApiModel(value = "EnterpriseApplication",
        description = "Information related to Enterprise Application.")
public class EnterpriseApplication extends CommandOperation {

    @ApiModelProperty(name = "identifier", value = "Device Identifier.", required = true)
    private String identifier;
    @ApiModelProperty(name = "manifestURL", value = "Manifest URL.", required = true)
    private String manifestURL;
    @ApiModelProperty(name = "removeAppUponMDMProfileRemoval", value = "remove or not status of the MDM profile.", required = true)
    private Boolean removeAppUponMDMProfileRemoval;
    @ApiModelProperty(name = "preventBackupOfAppData", value = "Prevent or not status of the App Data Backup.", required = true)
    private Boolean preventBackupOfAppData;

    @Override
    public void validateRequest() throws ProfileConfigurationException {
        if (manifestURL == null || manifestURL.trim().isEmpty()) {
            throw new ProfileConfigurationException("Manifest URL is not found for enterprise app installation");
        }
    }

    public String getIdentifier() {
        return identifier;
    }

    public void setIdentifier(String identifier) {
        this.identifier = identifier;
    }

    public String getManifestURL() {
        return manifestURL;
    }

    public void setManifestURL(String manifestURL) {
        this.manifestURL = manifestURL;
    }

    public Boolean getRemoveAppUponMDMProfileRemoval() {
        return removeAppUponMDMProfileRemoval;
    }

    public void setRemoveAppUponMDMProfileRemoval(Boolean removeAppUponMDMProfileRemoval) {
        this.removeAppUponMDMProfileRemoval = removeAppUponMDMProfileRemoval;
    }

    public Boolean getPreventBackupOfAppData() {
        return preventBackupOfAppData;
    }

    public void setPreventBackupOfAppData(Boolean preventBackupOfAppData) {
        this.preventBackupOfAppData = preventBackupOfAppData;
    }
}
