package org.wso2.carbon.device.mgt.ios.payload.beans;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.wso2.carbon.device.mgt.ios.payload.exception.ProfileConfigurationException;

import java.util.List;

@ApiModel(
        value = "Cellular",
        description = "This class carries all information related cellular."
)
public class Cellular extends PayloadOperation {

    @ApiModelProperty(
            name = "attachAPNName",
            value = "attach APN name.",
            required = true
    )
    private String attachAPNName;
    private AuthenticationType authenticationType;
    @ApiModelProperty(
            name = "username",
            value = "UserName.",
            required = true
    )
    private String username;
    @ApiModelProperty(
            name = "password",
            value = "password",
            required = true
    )
    private String password;
    @ApiModelProperty(
            name = "apnConfiguration",
            value = "List of apn configurations",
            required = true
    )
    private List<APNConfiguration> apnConfigurations;

    public String getAttachAPNName() {
        return attachAPNName;
    }

    public void setAttachAPNName(String attachAPNName) {
        this.attachAPNName = attachAPNName;
    }

    public AuthenticationType getAuthenticationType() {
        return authenticationType;
    }

    public void setAuthenticationType(AuthenticationType authenticationType) {
        this.authenticationType = authenticationType;
    }

    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 List<APNConfiguration> getApnConfigurations() {
        return apnConfigurations;
    }

    public void setApnConfigurations(List<APNConfiguration> apnConfigurations) {
        this.apnConfigurations = apnConfigurations;
    }

    @Override
    public void validateRequest() throws ProfileConfigurationException {
        if(getAttachAPNName() == null) {
            throw new ProfileConfigurationException("AttachAPN name cannot be empty");
        }
    }

}
