001package com.box.sdkgen.schemas.aiagentreference;
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.databind.annotation.JsonDeserialize;
008import com.fasterxml.jackson.databind.annotation.JsonSerialize;
009import java.util.Objects;
010
011/** The AI agent used to handle queries. */
012@JsonFilter("nullablePropertyFilter")
013public class AiAgentReference extends SerializableObject {
014
015  /** The type of AI agent used to handle queries. */
016  @JsonDeserialize(using = AiAgentReferenceTypeField.AiAgentReferenceTypeFieldDeserializer.class)
017  @JsonSerialize(using = AiAgentReferenceTypeField.AiAgentReferenceTypeFieldSerializer.class)
018  protected EnumWrapper<AiAgentReferenceTypeField> type;
019
020  /**
021   * The ID of an Agent. This can be a numeric ID for custom agents (for example, `14031`) or a
022   * unique identifier for pre-built agents (for example, `enhanced_extract_agent` for the [Enhanced
023   * Extract
024   * Agent](https://developer.box.com/guides/box-ai/ai-tutorials/extract-metadata-structured#enhanced-extract-agent)).
025   */
026  protected String id;
027
028  public AiAgentReference() {
029    super();
030    this.type = new EnumWrapper<AiAgentReferenceTypeField>(AiAgentReferenceTypeField.AI_AGENT_ID);
031  }
032
033  protected AiAgentReference(Builder builder) {
034    super();
035    this.type = builder.type;
036    this.id = builder.id;
037    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
038  }
039
040  public EnumWrapper<AiAgentReferenceTypeField> getType() {
041    return type;
042  }
043
044  public String getId() {
045    return id;
046  }
047
048  @Override
049  public boolean equals(Object o) {
050    if (this == o) {
051      return true;
052    }
053    if (o == null || getClass() != o.getClass()) {
054      return false;
055    }
056    AiAgentReference casted = (AiAgentReference) o;
057    return Objects.equals(type, casted.type) && Objects.equals(id, casted.id);
058  }
059
060  @Override
061  public int hashCode() {
062    return Objects.hash(type, id);
063  }
064
065  @Override
066  public String toString() {
067    return "AiAgentReference{" + "type='" + type + '\'' + ", " + "id='" + id + '\'' + "}";
068  }
069
070  public static class Builder extends NullableFieldTracker {
071
072    protected EnumWrapper<AiAgentReferenceTypeField> type;
073
074    protected String id;
075
076    public Builder() {
077      super();
078    }
079
080    public Builder type(AiAgentReferenceTypeField type) {
081      this.type = new EnumWrapper<AiAgentReferenceTypeField>(type);
082      return this;
083    }
084
085    public Builder type(EnumWrapper<AiAgentReferenceTypeField> type) {
086      this.type = type;
087      return this;
088    }
089
090    public Builder id(String id) {
091      this.id = id;
092      return this;
093    }
094
095    public AiAgentReference build() {
096      if (this.type == null) {
097        this.type =
098            new EnumWrapper<AiAgentReferenceTypeField>(AiAgentReferenceTypeField.AI_AGENT_ID);
099      }
100      return new AiAgentReference(this);
101    }
102  }
103}