com.softlayer.api.service.Survey Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of softlayer-api-client Show documentation
Show all versions of softlayer-api-client Show documentation
API client for accessing the SoftLayer API
package com.softlayer.api.service;
import com.softlayer.api.ApiClient;
import com.softlayer.api.ResponseHandler;
import com.softlayer.api.annotation.ApiMethod;
import com.softlayer.api.annotation.ApiProperty;
import com.softlayer.api.annotation.ApiType;
import com.softlayer.api.service.Entity;
import com.softlayer.api.service.survey.Question;
import com.softlayer.api.service.survey.Response;
import com.softlayer.api.service.survey.Status;
import com.softlayer.api.service.survey.Type;
import java.util.ArrayList;
import java.util.GregorianCalendar;
import java.util.List;
import java.util.concurrent.Future;
/**
* The SoftLayer_Survey data type contains general information relating to a single SoftLayer survey.
*
* @see SoftLayer_Survey
*/
@ApiType("SoftLayer_Survey")
public class Survey extends Entity {
/**
* The questions for a survey.
*/
@ApiProperty
protected List questions;
public List getQuestions() {
if (questions == null) {
questions = new ArrayList();
}
return questions;
}
/**
* The status of the survey
*/
@ApiProperty
protected Status status;
public Status getStatus() {
return status;
}
public void setStatus(Status status) {
this.status = status;
}
/**
* The type of survey
*/
@ApiProperty
protected Type type;
public Type getType() {
return type;
}
public void setType(Type type) {
this.type = type;
}
/**
* A flag indicating if a survey can be taken.
*/
@ApiProperty(canBeNullOrNotSet = true)
protected Long active;
public Long getActive() {
return active;
}
public void setActive(Long active) {
activeSpecified = true;
this.active = active;
}
protected boolean activeSpecified;
public boolean isActiveSpecified() {
return activeSpecified;
}
public void unsetActive() {
active = null;
activeSpecified = false;
}
/**
* The date that a survey had originally started.
*/
@ApiProperty(canBeNullOrNotSet = true)
protected GregorianCalendar createDate;
public GregorianCalendar getCreateDate() {
return createDate;
}
public void setCreateDate(GregorianCalendar createDate) {
createDateSpecified = true;
this.createDate = createDate;
}
protected boolean createDateSpecified;
public boolean isCreateDateSpecified() {
return createDateSpecified;
}
public void unsetCreateDate() {
createDate = null;
createDateSpecified = false;
}
/**
* A survey's id.
*/
@ApiProperty(canBeNullOrNotSet = true)
protected Long id;
public Long getId() {
return id;
}
public void setId(Long id) {
idSpecified = true;
this.id = id;
}
protected boolean idSpecified;
public boolean isIdSpecified() {
return idSpecified;
}
public void unsetId() {
id = null;
idSpecified = false;
}
/**
* A survey's name or title.
*/
@ApiProperty(canBeNullOrNotSet = true)
protected String name;
public String getName() {
return name;
}
public void setName(String name) {
nameSpecified = true;
this.name = name;
}
protected boolean nameSpecified;
public boolean isNameSpecified() {
return nameSpecified;
}
public void unsetName() {
name = null;
nameSpecified = false;
}
/**
* The status id of the survey.
*/
@ApiProperty(canBeNullOrNotSet = true)
protected Long statusId;
public Long getStatusId() {
return statusId;
}
public void setStatusId(Long statusId) {
statusIdSpecified = true;
this.statusId = statusId;
}
protected boolean statusIdSpecified;
public boolean isStatusIdSpecified() {
return statusIdSpecified;
}
public void unsetStatusId() {
statusId = null;
statusIdSpecified = false;
}
/**
* The type id of the survey.
*/
@ApiProperty(canBeNullOrNotSet = true)
protected Long typeId;
public Long getTypeId() {
return typeId;
}
public void setTypeId(Long typeId) {
typeIdSpecified = true;
this.typeId = typeId;
}
protected boolean typeIdSpecified;
public boolean isTypeIdSpecified() {
return typeIdSpecified;
}
public void unsetTypeId() {
typeId = null;
typeIdSpecified = false;
}
/**
* A count of the questions for a survey.
*/
@ApiProperty
protected Long questionCount;
public Long getQuestionCount() {
return questionCount;
}
public void setQuestionCount(Long questionCount) {
this.questionCount = questionCount;
}
public Service asService(ApiClient client) {
return service(client, id);
}
public static Service service(ApiClient client) {
return client.createService(Service.class, null);
}
public static Service service(ApiClient client, Long id) {
return client.createService(Service.class, id == null ? null : id.toString());
}
/**
* Every SoftLayer survey is defined in the SoftLayer_Survey service. Softlayer survey's have questions and answers from SoftLayer users.
*
* @see SoftLayer_Survey
*/
@com.softlayer.api.annotation.ApiService("SoftLayer_Survey")
public static interface Service extends com.softlayer.api.Service {
public ServiceAsync asAsync();
public Mask withNewMask();
public Mask withMask();
public void setMask(Mask mask);
/**
* Provides survey details for the given type
*
* @see SoftLayer_Survey::getActiveSurveyByType
*/
@ApiMethod
public Survey getActiveSurveyByType(String type);
/**
* getObject retrieves the SoftLayer_Survey object whose ID number corresponds to the ID number of the init parameter passed to the SoftLayer_Survey service. You can only retrieve the survey that your portal user has taken.
*
* @see SoftLayer_Survey::getObject
*/
@ApiMethod(instanceRequired = true)
public Survey getObject();
/**
* Response to a SoftLayer survey's questions.
*
* @see SoftLayer_Survey::takeSurvey
*/
@ApiMethod(instanceRequired = true)
public Boolean takeSurvey(List responses);
/**
* The questions for a survey.
*
* @see SoftLayer_Survey::getQuestions
*/
@ApiMethod(instanceRequired = true)
public List getQuestions();
/**
* The status of the survey
*
* @see SoftLayer_Survey::getStatus
*/
@ApiMethod(instanceRequired = true)
public Status getStatus();
/**
* The type of survey
*
* @see SoftLayer_Survey::getType
*/
@ApiMethod(instanceRequired = true)
public Type getType();
}
public static interface ServiceAsync extends com.softlayer.api.ServiceAsync {
public Mask withNewMask();
public Mask withMask();
public void setMask(Mask mask);
/**
* Async version of {@link Service#getActiveSurveyByType}
*/
public Future getActiveSurveyByType(String type);
public Future> getActiveSurveyByType(String type, ResponseHandler callback);
/**
* Async version of {@link Service#getObject}
*/
public Future getObject();
public Future> getObject(ResponseHandler callback);
/**
* Async version of {@link Service#takeSurvey}
*/
public Future takeSurvey(List responses);
public Future> takeSurvey(List responses, ResponseHandler callback);
/**
* Async version of {@link Service#getQuestions}
*/
public Future> getQuestions();
/**
* Async callback version of {@link Service#getQuestions}
*/
public Future> getQuestions(ResponseHandler> callback);
/**
* Async version of {@link Service#getStatus}
*/
public Future getStatus();
/**
* Async callback version of {@link Service#getStatus}
*/
public Future> getStatus(ResponseHandler callback);
/**
* Async version of {@link Service#getType}
*/
public Future getType();
/**
* Async callback version of {@link Service#getType}
*/
public Future> getType(ResponseHandler callback);
}
public static class Mask extends Entity.Mask {
public com.softlayer.api.service.survey.Question.Mask questions() {
return withSubMask("questions", com.softlayer.api.service.survey.Question.Mask.class);
}
public com.softlayer.api.service.survey.Status.Mask status() {
return withSubMask("status", com.softlayer.api.service.survey.Status.Mask.class);
}
public com.softlayer.api.service.survey.Type.Mask type() {
return withSubMask("type", com.softlayer.api.service.survey.Type.Mask.class);
}
public Mask active() {
withLocalProperty("active");
return this;
}
public Mask createDate() {
withLocalProperty("createDate");
return this;
}
public Mask id() {
withLocalProperty("id");
return this;
}
public Mask name() {
withLocalProperty("name");
return this;
}
public Mask statusId() {
withLocalProperty("statusId");
return this;
}
public Mask typeId() {
withLocalProperty("typeId");
return this;
}
public Mask questionCount() {
withLocalProperty("questionCount");
return this;
}
}
}