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 = "Email", description = "Details of User Email account.")
public class Email extends PayloadOperation {

    @ApiModelProperty(name = "emailAccountDescription", value = "Description of the Email Account.", required = true)
    private String emailAccountDescription;
    @ApiModelProperty(name = "emailAccountName", value = "Name of the Email account.", required = true)
    private String emailAccountName;
    @ApiModelProperty(name = "emailAccountType", value = "Type of the Email account.", required = true)
    private EmailAccountType emailAccountType;
    @ApiModelProperty(name = "emailAddress", value = "Email Address.", required = true)
    private String emailAddress;
    @ApiModelProperty(name = "incomingMailServerAuthentication", value = "Type of mail server authentication.", required = true)
    private MailServerAuthentication incomingMailServerAuthentication;
    @ApiModelProperty(name = "incomingMailServerHostName", value = "Mail server host name.", required = true)
    private String incomingMailServerHostName;
    @ApiModelProperty(name = "incomingMailServerPortNumber", value = "Port number of the incoming Mail server.", required = true)
    private Integer incomingMailServerPortNumber;
    @ApiModelProperty(name = "incomingMailServerUseSSL", value = "Incoming Mail Server Use SSl.", required = true)
    private Boolean incomingMailServerUseSSL;
    @ApiModelProperty(name = "incomingMailServerUsername", value = "User name of the incoming mail server.", required = true)
    private String incomingMailServerUsername;
    @ApiModelProperty(name = "incomingPassword", value = "Incoming mail password.", required = true)
    private String incomingPassword;
    @ApiModelProperty(name = "outgoingPassword", value = "Outgoing password.", required = true)
    private String outgoingPassword;
    @ApiModelProperty(name = "outgoingPasswordSameAsIncomingPassword", value = "Same or different status of the incoming and outgoing password.", required = true)
    private Boolean outgoingPasswordSameAsIncomingPassword;
    @ApiModelProperty(name = "outgoingMailServerAuthentication", value = "Authentication type of the outgoing mail server.", required = true)
    private MailServerAuthentication outgoingMailServerAuthentication;
    @ApiModelProperty(name = "outgoingMailServerHostName", value = "Host name of the outgoing mail server.", required = true)
    private String outgoingMailServerHostName;
    @ApiModelProperty(name = "outgoingMailServerPortNumber", value = "Port number of the outgoing mail server.", required = true)
    private Integer outgoingMailServerPortNumber;
    @ApiModelProperty(name = "outgoingMailServerUseSSL", value = "Outgoing mail server Use SSL.", required = true)
    private Boolean outgoingMailServerUseSSL;
    @ApiModelProperty(name = "outgoingMailServerUsername", value = "User name of the outgoing mail server.", required = true)
    private String outgoingMailServerUsername;
    @ApiModelProperty(name = "preventMove", value = "Status of the prevent move.", required = true)
    private Boolean preventMove;
    @ApiModelProperty(name = "preventAppSheet", value = "Status of the prevent sheet.", required = true)
    private Boolean preventAppSheet;
    @ApiModelProperty(name = "SMIMEEnabled", value = "Enable/disable status of the SMIME.", required = true)
    private Boolean SMIMEEnabled;
    @ApiModelProperty(name = "SMIMESigningCertificateUUID", value = "UUID of the SMIME Signing certificate.", required = true)
    private String SMIMESigningCertificateUUID;
    @ApiModelProperty(name = "SMIMEEncryptionCertificateUUID", value = "UUID of the SMIM EEncryption Certificate.", required = true)
    private String SMIMEEncryptionCertificateUUID;
    @ApiModelProperty(name = "SMIMEEnablePerMessageSwitch", value = "Status of the Message password enable for SMIME.", required = true)
    private Boolean SMIMEEnablePerMessageSwitch;
    @ApiModelProperty(name = "disableMailRecentsSyncing", value = "Disable/Enable status of the Mail Recent Syncing.", required = true)
    private Boolean disableMailRecentsSyncing;
    @ApiModelProperty(name = "incomingMailServerIMAPPathPrefix", value = "Path prfix of the Mail server IMAPP.", required = true)
    private String incomingMailServerIMAPPathPrefix;

    @Override
    public void validateRequest() throws ProfileConfigurationException {

        if (emailAccountType == null) {
            throw new ProfileConfigurationException("Email account type is empty");
        }

        if (incomingMailServerAuthentication == null) {
            throw new ProfileConfigurationException("Incoming mail server authentication type is empty");
        }

        if (StringUtils.isEmpty(incomingMailServerHostName)) {
            throw new ProfileConfigurationException("Incoming mail server host name is empty");
        }

        if (outgoingMailServerAuthentication == null) {
            throw new ProfileConfigurationException("Outgoing mail server authentication type is empty");
        }

        if (StringUtils.isEmpty(outgoingMailServerHostName)) {
            throw new ProfileConfigurationException("Outgoing mail server host name is empty");
        }

        if (disableMailRecentsSyncing == null) {
            throw new ProfileConfigurationException("Disabling recents mail sync is empty");
        }
    }

    public String getEmailAccountDescription() {
        return emailAccountDescription;
    }

    public void setEmailAccountDescription(String emailAccountDescription) {
        this.emailAccountDescription = emailAccountDescription;
    }

    public String getEmailAccountName() {
        return emailAccountName;
    }

    public void setEmailAccountName(String emailAccountName) {
        this.emailAccountName = emailAccountName;
    }

    public EmailAccountType getEmailAccountType() {
        return emailAccountType;
    }

    public void setEmailAccountType(EmailAccountType emailAccountType) {
        this.emailAccountType = emailAccountType;
    }

    public String getEmailAddress() {
        return emailAddress;
    }

    public void setEmailAddress(String emailAddress) {
        this.emailAddress = emailAddress;
    }

    public MailServerAuthentication getIncomingMailServerAuthentication() {
        return incomingMailServerAuthentication;
    }

    public void setIncomingMailServerAuthentication(MailServerAuthentication incomingMailServerAuthentication) {
        this.incomingMailServerAuthentication = incomingMailServerAuthentication;
    }

    public String getIncomingMailServerHostName() {
        return incomingMailServerHostName;
    }

    public void setIncomingMailServerHostName(String incomingMailServerHostName) {
        this.incomingMailServerHostName = incomingMailServerHostName;
    }

    public Integer getIncomingMailServerPortNumber() {
        return incomingMailServerPortNumber;
    }

    public void setIncomingMailServerPortNumber(Integer incomingMailServerPortNumber) {
        this.incomingMailServerPortNumber = incomingMailServerPortNumber;
    }

    public Boolean getIncomingMailServerUseSSL() {
        return incomingMailServerUseSSL;
    }

    public void setIncomingMailServerUseSSL(Boolean incomingMailServerUseSSL) {
        this.incomingMailServerUseSSL = incomingMailServerUseSSL;
    }

    public String getIncomingMailServerUsername() {
        return incomingMailServerUsername;
    }

    public void setIncomingMailServerUsername(String incomingMailServerUsername) {
        this.incomingMailServerUsername = incomingMailServerUsername;
    }

    public String getIncomingPassword() {
        return incomingPassword;
    }

    public void setIncomingPassword(String incomingPassword) {
        this.incomingPassword = incomingPassword;
    }

    public String getOutgoingPassword() {
        return outgoingPassword;
    }

    public void setOutgoingPassword(String outgoingPassword) {
        this.outgoingPassword = outgoingPassword;
    }

    public Boolean getOutgoingPasswordSameAsIncomingPassword() {
        return outgoingPasswordSameAsIncomingPassword;
    }

    public void setOutgoingPasswordSameAsIncomingPassword(Boolean outgoingPasswordSameAsIncomingPassword) {
        this.outgoingPasswordSameAsIncomingPassword = outgoingPasswordSameAsIncomingPassword;
    }

    public MailServerAuthentication getOutgoingMailServerAuthentication() {
        return outgoingMailServerAuthentication;
    }

    public void setOutgoingMailServerAuthentication(MailServerAuthentication outgoingMailServerAuthentication) {
        this.outgoingMailServerAuthentication = outgoingMailServerAuthentication;
    }

    public String getOutgoingMailServerHostName() {
        return outgoingMailServerHostName;
    }

    public void setOutgoingMailServerHostName(String outgoingMailServerHostName) {
        this.outgoingMailServerHostName = outgoingMailServerHostName;
    }

    public Integer getOutgoingMailServerPortNumber() {
        return outgoingMailServerPortNumber;
    }

    public void setOutgoingMailServerPortNumber(Integer outgoingMailServerPortNumber) {
        this.outgoingMailServerPortNumber = outgoingMailServerPortNumber;
    }

    public Boolean getOutgoingMailServerUseSSL() {
        return outgoingMailServerUseSSL;
    }

    public void setOutgoingMailServerUseSSL(Boolean outgoingMailServerUseSSL) {
        this.outgoingMailServerUseSSL = outgoingMailServerUseSSL;
    }

    public String getOutgoingMailServerUsername() {
        return outgoingMailServerUsername;
    }

    public void setOutgoingMailServerUsername(String outgoingMailServerUsername) {
        this.outgoingMailServerUsername = outgoingMailServerUsername;
    }

    public Boolean getPreventMove() {
        return preventMove;
    }

    public void setPreventMove(Boolean preventMove) {
        this.preventMove = preventMove;
    }

    public Boolean getPreventAppSheet() {
        return preventAppSheet;
    }

    public void setPreventAppSheet(Boolean preventAppSheet) {
        this.preventAppSheet = preventAppSheet;
    }

    public Boolean getSMIMEEnabled() {
        return SMIMEEnabled;
    }

    public void setSMIMEEnabled(Boolean SMIMEEnabled) {
        this.SMIMEEnabled = SMIMEEnabled;
    }

    public String getSMIMESigningCertificateUUID() {
        return SMIMESigningCertificateUUID;
    }

    public void setSMIMESigningCertificateUUID(String SMIMESigningCertificateUUID) {
        this.SMIMESigningCertificateUUID = SMIMESigningCertificateUUID;
    }

    public String getSMIMEEncryptionCertificateUUID() {
        return SMIMEEncryptionCertificateUUID;
    }

    public void setSMIMEEncryptionCertificateUUID(String SMIMEEncryptionCertificateUUID) {
        this.SMIMEEncryptionCertificateUUID = SMIMEEncryptionCertificateUUID;
    }

    public Boolean getSMIMEEnablePerMessageSwitch() {
        return SMIMEEnablePerMessageSwitch;
    }

    public void setSMIMEEnablePerMessageSwitch(Boolean SMIMEEnablePerMessageSwitch) {
        this.SMIMEEnablePerMessageSwitch = SMIMEEnablePerMessageSwitch;
    }

    public Boolean getDisableMailRecentsSyncing() {
        return disableMailRecentsSyncing;
    }

    public void setDisableMailRecentsSyncing(Boolean disableMailRecentsSyncing) {
        this.disableMailRecentsSyncing = disableMailRecentsSyncing;
    }

    public String getIncomingMailServerIMAPPathPrefix() {
        return incomingMailServerIMAPPathPrefix;
    }

    public void setIncomingMailServerIMAPPathPrefix(String incomingMailServerIMAPPathPrefix) {
        this.incomingMailServerIMAPPathPrefix = incomingMailServerIMAPPathPrefix;
    }
}
