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 = "WebClip",
        description = "Information related to WebClip.")
public class WebClip extends PayloadOperation {

    @ApiModelProperty(name = "URL",
            value = "URL.", required = true)
    private String URL;
    @ApiModelProperty(name = "label",
            value = "Label.", required = true)
    private String label;
    @ApiModelProperty(name = "icon",
            value = "Icon.", required = true)
    private String icon;
    @ApiModelProperty(name = "isRemovable",
            value = "status of Removable.", required = true)
    private Boolean isRemovable;
    @ApiModelProperty(name = "isFullscreen",
            value = "Full screen status.", required = true)
    private Boolean isFullscreen;
    @ApiModelProperty(name = "isPrecomposed",
            value = "Status of pre-composed.", required = true)
    private Boolean isPrecomposed;

    @Override
    public void validateRequest() throws ProfileConfigurationException {

        if (StringUtils.isEmpty(URL)) {
            throw new ProfileConfigurationException("URL is empty");
        }

        if (StringUtils.isEmpty(label)) {
            throw new ProfileConfigurationException("Label is empty");
        }
    }

    public String getURL() {
        return URL;
    }

    public void setURL(String URL) {
        this.URL = URL;
    }

    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label;
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }

    public Boolean getIsRemovable() {
        return isRemovable;
    }

    public void setIsRemovable(Boolean isRemovable) {
        this.isRemovable = isRemovable;
    }

    public Boolean getIsFullscreen() {
        return isFullscreen;
    }

    public void setIsFullscreen(Boolean isFullscreen) {
        this.isFullscreen = isFullscreen;
    }

    public Boolean getIsPrecomposed() {
        return isPrecomposed;
    }

    public void setIsPrecomposed(Boolean isPrecomposed) {
        this.isPrecomposed = isPrecomposed;
    }
}
