package org.wfc.omada.api.hotspot.model;

import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.validation.Valid;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

/**
 * Answers submitted by users.
 */
@ApiModel(description = "Answers submitted by users.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-04T11:35:35.496+08:00[Asia/Shanghai]")

public class FormAuthCardAnswerOpenApiVo   {
  @JsonProperty("type")
  private Integer type;

  @JsonProperty("choiceAnswer")
  @Valid
  private List<Integer> choiceAnswer = null;

  @JsonProperty("inputAnswer")
  private String inputAnswer;

  @JsonProperty("score")
  private Integer score;

  @JsonProperty("others")
  private String others;

  public FormAuthCardAnswerOpenApiVo type(Integer type) {
    this.type = type;
    return this;
  }

  /**
   * Type should be a value as follows: 0: single choice; 1: multiple choice; 2: ComboBox; 3: input; 4: score; 5: prompt box
   * @return type
  */
  @ApiModelProperty(value = "Type should be a value as follows: 0: single choice; 1: multiple choice; 2: ComboBox; 3: input; 4: score; 5: prompt box")


  public Integer getType() {
    return type;
  }

  public void setType(Integer type) {
    this.type = type;
  }

  public FormAuthCardAnswerOpenApiVo choiceAnswer(List<Integer> choiceAnswer) {
    this.choiceAnswer = choiceAnswer;
    return this;
  }

  public FormAuthCardAnswerOpenApiVo addChoiceAnswerItem(Integer choiceAnswerItem) {
    if (this.choiceAnswer == null) {
      this.choiceAnswer = new ArrayList<>();
    }
    this.choiceAnswer.add(choiceAnswerItem);
    return this;
  }

  /**
   * Drop-down menu or answer list for multiple-choice questions (exists if and only if cardType is 0, 1, 2)
   * @return choiceAnswer
  */
  @ApiModelProperty(value = "Drop-down menu or answer list for multiple-choice questions (exists if and only if cardType is 0, 1, 2)")


  public List<Integer> getChoiceAnswer() {
    return choiceAnswer;
  }

  public void setChoiceAnswer(List<Integer> choiceAnswer) {
    this.choiceAnswer = choiceAnswer;
  }

  public FormAuthCardAnswerOpenApiVo inputAnswer(String inputAnswer) {
    this.inputAnswer = inputAnswer;
    return this;
  }

  /**
   * Answers entered by the user, which corresponds to the question and answer question or the scored evaluation, or the input of other options in the multiple-choice question. Determined according to the type field. 0, 1, and 2 indicate other options answers, 3 indicates the answer in the input box, and 4 indicates the scored evaluation. InputAnswer should contain 1-2000 characters
   * @return inputAnswer
  */
  @ApiModelProperty(value = "Answers entered by the user, which corresponds to the question and answer question or the scored evaluation, or the input of other options in the multiple-choice question. Determined according to the type field. 0, 1, and 2 indicate other options answers, 3 indicates the answer in the input box, and 4 indicates the scored evaluation. InputAnswer should contain 1-2000 characters")


  public String getInputAnswer() {
    return inputAnswer;
  }

  public void setInputAnswer(String inputAnswer) {
    this.inputAnswer = inputAnswer;
  }

  public FormAuthCardAnswerOpenApiVo score(Integer score) {
    this.score = score;
    return this;
  }

  /**
   * User rating (should be within the range of 1-5), exists when type is 4
   * @return score
  */
  @ApiModelProperty(value = "User rating (should be within the range of 1-5), exists when type is 4")


  public Integer getScore() {
    return score;
  }

  public void setScore(Integer score) {
    this.score = score;
  }

  public FormAuthCardAnswerOpenApiVo others(String others) {
    this.others = others;
    return this;
  }

  /**
   * Exists when cardType is 0, 1 and the user adds other options. Used to save the option answer corresponding to the prompt of other options. Assuming that the user adds two other options, D and E, and choiceAnswer contains 3 ( D), 4 (E), then others[0] represents the answer of option D. Others should contain 1-2000 characters
   * @return others
  */
  @ApiModelProperty(value = "Exists when cardType is 0, 1 and the user adds other options. Used to save the option answer corresponding to the prompt of other options. Assuming that the user adds two other options, D and E, and choiceAnswer contains 3 ( D), 4 (E), then others[0] represents the answer of option D. Others should contain 1-2000 characters")


  public String getOthers() {
    return others;
  }

  public void setOthers(String others) {
    this.others = others;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    FormAuthCardAnswerOpenApiVo formAuthCardAnswerOpenApiVo = (FormAuthCardAnswerOpenApiVo) o;
    return Objects.equals(this.type, formAuthCardAnswerOpenApiVo.type) &&
        Objects.equals(this.choiceAnswer, formAuthCardAnswerOpenApiVo.choiceAnswer) &&
        Objects.equals(this.inputAnswer, formAuthCardAnswerOpenApiVo.inputAnswer) &&
        Objects.equals(this.score, formAuthCardAnswerOpenApiVo.score) &&
        Objects.equals(this.others, formAuthCardAnswerOpenApiVo.others);
  }

  @Override
  public int hashCode() {
    return Objects.hash(type, choiceAnswer, inputAnswer, score, others);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class FormAuthCardAnswerOpenApiVo {\n");
    
    sb.append("    type: ").append(toIndentedString(type)).append("\n");
    sb.append("    choiceAnswer: ").append(toIndentedString(choiceAnswer)).append("\n");
    sb.append("    inputAnswer: ").append(toIndentedString(inputAnswer)).append("\n");
    sb.append("    score: ").append(toIndentedString(score)).append("\n");
    sb.append("    others: ").append(toIndentedString(others)).append("\n");
    sb.append("}");
    return sb.toString();
  }

  /**
   * Convert the given object to string with each line indented by 4 spaces
   * (except the first line).
   */
  private String toIndentedString(Object o) {
    if (o == null) {
      return "null";
    }
    return o.toString().replace("\n", "\n    ");
  }
}

