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


    @ApiModelProperty(name = "accountDescription",
            value = "Account Description.", required = true)
    private String accountDescription;
    @ApiModelProperty(name = "hostName",
            value = "HostName.", required = true)
    private String hostName;

    @ApiModelProperty(name = "username",
            value = "Username.", required = true)
    private String username;

    @ApiModelProperty(name = "password",
            value = "Password.", required = true)
    private String password;

    @ApiModelProperty(name = "useSSL",
            value = "useSSl.", required = true)
    private Boolean useSSL;

    @ApiModelProperty(name = "port",
            value = "Port.", required = true)
    private Integer port;

    @ApiModelProperty(name = "principalURL",
            value = "Principle URL.", required = true)
    private String principalURL;

    @Override
    public void validateRequest() throws ProfileConfigurationException {

        if (StringUtils.isEmpty(hostName)) {
            throw new ProfileConfigurationException("Host name is empty");
        }

    }

    public String getAccountDescription() {
        return accountDescription;
    }

    public void setAccountDescription(String accountDescription) {
        this.accountDescription = accountDescription;
    }

    public String getHostName() {
        return hostName;
    }

    public void setHostName(String hostName) {
        this.hostName = hostName;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public Boolean getUseSSL() {
        return useSSL;
    }

    public void setUseSSL(Boolean useSSL) {
        this.useSSL = useSSL;
    }

    public Integer getPort() {
        return port;
    }

    public void setPort(Integer port) {
        this.port = port;
    }

    public String getPrincipalURL() {
        return principalURL;
    }

    public void setPrincipalURL(String principalURL) {
        this.principalURL = principalURL;
    }
}
