001package com.box.sdkgen.schemas.aitaxonomyreference;
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 source to be used for the structured extraction. For your request to work, `fields`
014 * must also be provided.
015 */
016@JsonFilter("nullablePropertyFilter")
017public class AiTaxonomyReference extends SerializableObject {
018
019  /** The type of the taxonomy source. */
020  @JsonDeserialize(
021      using = AiTaxonomyReferenceTypeField.AiTaxonomyReferenceTypeFieldDeserializer.class)
022  @JsonSerialize(using = AiTaxonomyReferenceTypeField.AiTaxonomyReferenceTypeFieldSerializer.class)
023  protected EnumWrapper<AiTaxonomyReferenceTypeField> type;
024
025  /**
026   * The identifier for a taxonomy, which corresponds to the `taxonomy_key` of the taxonomy source.
027   */
028  @JsonProperty("taxonomy_key")
029  protected String taxonomyKey;
030
031  /** The namespace of the taxonomy source. */
032  protected String namespace;
033
034  public AiTaxonomyReference() {
035    super();
036  }
037
038  protected AiTaxonomyReference(Builder builder) {
039    super();
040    this.type = builder.type;
041    this.taxonomyKey = builder.taxonomyKey;
042    this.namespace = builder.namespace;
043    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
044  }
045
046  public EnumWrapper<AiTaxonomyReferenceTypeField> getType() {
047    return type;
048  }
049
050  public String getTaxonomyKey() {
051    return taxonomyKey;
052  }
053
054  public String getNamespace() {
055    return namespace;
056  }
057
058  @Override
059  public boolean equals(Object o) {
060    if (this == o) {
061      return true;
062    }
063    if (o == null || getClass() != o.getClass()) {
064      return false;
065    }
066    AiTaxonomyReference casted = (AiTaxonomyReference) o;
067    return Objects.equals(type, casted.type)
068        && Objects.equals(taxonomyKey, casted.taxonomyKey)
069        && Objects.equals(namespace, casted.namespace);
070  }
071
072  @Override
073  public int hashCode() {
074    return Objects.hash(type, taxonomyKey, namespace);
075  }
076
077  @Override
078  public String toString() {
079    return "AiTaxonomyReference{"
080        + "type='"
081        + type
082        + '\''
083        + ", "
084        + "taxonomyKey='"
085        + taxonomyKey
086        + '\''
087        + ", "
088        + "namespace='"
089        + namespace
090        + '\''
091        + "}";
092  }
093
094  public static class Builder extends NullableFieldTracker {
095
096    protected EnumWrapper<AiTaxonomyReferenceTypeField> type;
097
098    protected String taxonomyKey;
099
100    protected String namespace;
101
102    public Builder type(AiTaxonomyReferenceTypeField type) {
103      this.type = new EnumWrapper<AiTaxonomyReferenceTypeField>(type);
104      return this;
105    }
106
107    public Builder type(EnumWrapper<AiTaxonomyReferenceTypeField> type) {
108      this.type = type;
109      return this;
110    }
111
112    public Builder taxonomyKey(String taxonomyKey) {
113      this.taxonomyKey = taxonomyKey;
114      return this;
115    }
116
117    public Builder namespace(String namespace) {
118      this.namespace = namespace;
119      return this;
120    }
121
122    public AiTaxonomyReference build() {
123      return new AiTaxonomyReference(this);
124    }
125  }
126}