001package com.box.sdkgen.schemas.aitaxonomyfilereference;
002
003import com.box.sdkgen.internal.NullableFieldTracker;
004import com.box.sdkgen.internal.SerializableObject;
005import com.box.sdkgen.serialization.json.EnumWrapper;
006import com.fasterxml.jackson.annotation.JsonFilter;
007import com.fasterxml.jackson.annotation.JsonProperty;
008import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
009import com.fasterxml.jackson.databind.annotation.JsonSerialize;
010import java.util.Objects;
011
012/**
013 * A taxonomy `.csv` file to be used for the structured extraction. For your request to work,
014 * `fields` must also be provided.
015 */
016@JsonFilter("nullablePropertyFilter")
017public class AiTaxonomyFileReference extends SerializableObject {
018
019  /** The type of the taxonomy source. */
020  @JsonDeserialize(
021      using = AiTaxonomyFileReferenceTypeField.AiTaxonomyFileReferenceTypeFieldDeserializer.class)
022  @JsonSerialize(
023      using = AiTaxonomyFileReferenceTypeField.AiTaxonomyFileReferenceTypeFieldSerializer.class)
024  protected EnumWrapper<AiTaxonomyFileReferenceTypeField> type;
025
026  /**
027   * The identifier for a taxonomy, which corresponds to the `taxonomy_key` of the taxonomy source.
028   */
029  @JsonProperty("taxonomy_key")
030  protected String taxonomyKey;
031
032  /**
033   * The ID of the taxonomy source. Required if the type is `file` and unsupported if the type is
034   * `taxonomy`.
035   */
036  protected String id;
037
038  public AiTaxonomyFileReference() {
039    super();
040  }
041
042  protected AiTaxonomyFileReference(Builder builder) {
043    super();
044    this.type = builder.type;
045    this.taxonomyKey = builder.taxonomyKey;
046    this.id = builder.id;
047    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
048  }
049
050  public EnumWrapper<AiTaxonomyFileReferenceTypeField> getType() {
051    return type;
052  }
053
054  public String getTaxonomyKey() {
055    return taxonomyKey;
056  }
057
058  public String getId() {
059    return id;
060  }
061
062  @Override
063  public boolean equals(Object o) {
064    if (this == o) {
065      return true;
066    }
067    if (o == null || getClass() != o.getClass()) {
068      return false;
069    }
070    AiTaxonomyFileReference casted = (AiTaxonomyFileReference) o;
071    return Objects.equals(type, casted.type)
072        && Objects.equals(taxonomyKey, casted.taxonomyKey)
073        && Objects.equals(id, casted.id);
074  }
075
076  @Override
077  public int hashCode() {
078    return Objects.hash(type, taxonomyKey, id);
079  }
080
081  @Override
082  public String toString() {
083    return "AiTaxonomyFileReference{"
084        + "type='"
085        + type
086        + '\''
087        + ", "
088        + "taxonomyKey='"
089        + taxonomyKey
090        + '\''
091        + ", "
092        + "id='"
093        + id
094        + '\''
095        + "}";
096  }
097
098  public static class Builder extends NullableFieldTracker {
099
100    protected EnumWrapper<AiTaxonomyFileReferenceTypeField> type;
101
102    protected String taxonomyKey;
103
104    protected String id;
105
106    public Builder type(AiTaxonomyFileReferenceTypeField type) {
107      this.type = new EnumWrapper<AiTaxonomyFileReferenceTypeField>(type);
108      return this;
109    }
110
111    public Builder type(EnumWrapper<AiTaxonomyFileReferenceTypeField> type) {
112      this.type = type;
113      return this;
114    }
115
116    public Builder taxonomyKey(String taxonomyKey) {
117      this.taxonomyKey = taxonomyKey;
118      return this;
119    }
120
121    public Builder id(String id) {
122      this.id = id;
123      return this;
124    }
125
126    public AiTaxonomyFileReference build() {
127      return new AiTaxonomyFileReference(this);
128    }
129  }
130}