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

    @ApiModelProperty(name = "accountDescription",
            value = "Description of the Account.", required = true)
    private String accountDescription;
    @ApiModelProperty(name = "hostName",
            value = "Host name.", 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;

    @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;
    }
}
