001package com.box.sdkgen.schemas.aioptionsrules;
002
003import com.box.sdkgen.internal.NullableFieldTracker;
004import com.box.sdkgen.internal.SerializableObject;
005import com.fasterxml.jackson.annotation.JsonFilter;
006import com.fasterxml.jackson.annotation.JsonProperty;
007import java.util.List;
008import java.util.Objects;
009
010/**
011 * An object for a `taxonomy` type template field containing configuration for taxonomy options.
012 * Required if using `taxonomy` type field.
013 */
014@JsonFilter("nullablePropertyFilter")
015public class AiOptionsRules extends SerializableObject {
016
017  /**
018   * Indicates whether the field is a multi-select field. If true, the field can have multiple
019   * values.
020   */
021  @JsonProperty("multi_select")
022  protected Boolean multiSelect;
023
024  /**
025   * The selectable levels for the field. This is used to limit the levels of the taxonomy that can
026   * be selected.
027   */
028  @JsonProperty("selectable_levels")
029  protected List<Long> selectableLevels;
030
031  public AiOptionsRules() {
032    super();
033  }
034
035  protected AiOptionsRules(Builder builder) {
036    super();
037    this.multiSelect = builder.multiSelect;
038    this.selectableLevels = builder.selectableLevels;
039    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
040  }
041
042  public Boolean getMultiSelect() {
043    return multiSelect;
044  }
045
046  public List<Long> getSelectableLevels() {
047    return selectableLevels;
048  }
049
050  @Override
051  public boolean equals(Object o) {
052    if (this == o) {
053      return true;
054    }
055    if (o == null || getClass() != o.getClass()) {
056      return false;
057    }
058    AiOptionsRules casted = (AiOptionsRules) o;
059    return Objects.equals(multiSelect, casted.multiSelect)
060        && Objects.equals(selectableLevels, casted.selectableLevels);
061  }
062
063  @Override
064  public int hashCode() {
065    return Objects.hash(multiSelect, selectableLevels);
066  }
067
068  @Override
069  public String toString() {
070    return "AiOptionsRules{"
071        + "multiSelect='"
072        + multiSelect
073        + '\''
074        + ", "
075        + "selectableLevels='"
076        + selectableLevels
077        + '\''
078        + "}";
079  }
080
081  public static class Builder extends NullableFieldTracker {
082
083    protected Boolean multiSelect;
084
085    protected List<Long> selectableLevels;
086
087    public Builder multiSelect(Boolean multiSelect) {
088      this.multiSelect = multiSelect;
089      return this;
090    }
091
092    public Builder selectableLevels(List<Long> selectableLevels) {
093      this.selectableLevels = selectableLevels;
094      return this;
095    }
096
097    public AiOptionsRules build() {
098      return new AiOptionsRules(this);
099    }
100  }
101}