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

    @ApiModelProperty(name = "message",
            value = "Notification content.", required = true)
    private String messageText;
    private String messageTitle;

    public String getMessageText() {
        return messageText;
    }

    public void setMessageText(String messageText) {
        this.messageText = messageText;
    }

    public String getMessageTitle() {
        return messageTitle;
    }

    public void setMessageTitle(String messageTitle) {
        this.messageTitle = messageTitle;
    }

    @Override
    public void validateRequest() throws ProfileConfigurationException {

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

    }
}
