001package com.box.sdkgen.schemas.aiagentextractstructured;
002
003import com.box.sdkgen.internal.NullableFieldTracker;
004import com.box.sdkgen.internal.SerializableObject;
005import com.box.sdkgen.schemas.aiagentbasictexttool.AiAgentBasicTextTool;
006import com.box.sdkgen.schemas.aiagentlongtexttool.AiAgentLongTextTool;
007import com.box.sdkgen.serialization.json.EnumWrapper;
008import com.fasterxml.jackson.annotation.JsonFilter;
009import com.fasterxml.jackson.annotation.JsonProperty;
010import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
011import com.fasterxml.jackson.databind.annotation.JsonSerialize;
012import java.util.Objects;
013
014/** The AI agent to be used for structured extraction. */
015@JsonFilter("nullablePropertyFilter")
016public class AiAgentExtractStructured extends SerializableObject {
017
018  /** The type of AI agent to be used for extraction. */
019  @JsonDeserialize(
020      using = AiAgentExtractStructuredTypeField.AiAgentExtractStructuredTypeFieldDeserializer.class)
021  @JsonSerialize(
022      using = AiAgentExtractStructuredTypeField.AiAgentExtractStructuredTypeFieldSerializer.class)
023  protected EnumWrapper<AiAgentExtractStructuredTypeField> type;
024
025  @JsonProperty("long_text")
026  protected AiAgentLongTextTool longText;
027
028  @JsonProperty("basic_text")
029  protected AiAgentBasicTextTool basicText;
030
031  @JsonProperty("basic_image")
032  protected AiAgentBasicTextTool basicImage;
033
034  public AiAgentExtractStructured() {
035    super();
036    this.type =
037        new EnumWrapper<AiAgentExtractStructuredTypeField>(
038            AiAgentExtractStructuredTypeField.AI_AGENT_EXTRACT_STRUCTURED);
039  }
040
041  protected AiAgentExtractStructured(Builder builder) {
042    super();
043    this.type = builder.type;
044    this.longText = builder.longText;
045    this.basicText = builder.basicText;
046    this.basicImage = builder.basicImage;
047    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
048  }
049
050  public EnumWrapper<AiAgentExtractStructuredTypeField> getType() {
051    return type;
052  }
053
054  public AiAgentLongTextTool getLongText() {
055    return longText;
056  }
057
058  public AiAgentBasicTextTool getBasicText() {
059    return basicText;
060  }
061
062  public AiAgentBasicTextTool getBasicImage() {
063    return basicImage;
064  }
065
066  @Override
067  public boolean equals(Object o) {
068    if (this == o) {
069      return true;
070    }
071    if (o == null || getClass() != o.getClass()) {
072      return false;
073    }
074    AiAgentExtractStructured casted = (AiAgentExtractStructured) o;
075    return Objects.equals(type, casted.type)
076        && Objects.equals(longText, casted.longText)
077        && Objects.equals(basicText, casted.basicText)
078        && Objects.equals(basicImage, casted.basicImage);
079  }
080
081  @Override
082  public int hashCode() {
083    return Objects.hash(type, longText, basicText, basicImage);
084  }
085
086  @Override
087  public String toString() {
088    return "AiAgentExtractStructured{"
089        + "type='"
090        + type
091        + '\''
092        + ", "
093        + "longText='"
094        + longText
095        + '\''
096        + ", "
097        + "basicText='"
098        + basicText
099        + '\''
100        + ", "
101        + "basicImage='"
102        + basicImage
103        + '\''
104        + "}";
105  }
106
107  public static class Builder extends NullableFieldTracker {
108
109    protected EnumWrapper<AiAgentExtractStructuredTypeField> type;
110
111    protected AiAgentLongTextTool longText;
112
113    protected AiAgentBasicTextTool basicText;
114
115    protected AiAgentBasicTextTool basicImage;
116
117    public Builder() {
118      super();
119    }
120
121    public Builder type(AiAgentExtractStructuredTypeField type) {
122      this.type = new EnumWrapper<AiAgentExtractStructuredTypeField>(type);
123      return this;
124    }
125
126    public Builder type(EnumWrapper<AiAgentExtractStructuredTypeField> type) {
127      this.type = type;
128      return this;
129    }
130
131    public Builder longText(AiAgentLongTextTool longText) {
132      this.longText = longText;
133      return this;
134    }
135
136    public Builder basicText(AiAgentBasicTextTool basicText) {
137      this.basicText = basicText;
138      return this;
139    }
140
141    public Builder basicImage(AiAgentBasicTextTool basicImage) {
142      this.basicImage = basicImage;
143      return this;
144    }
145
146    public AiAgentExtractStructured build() {
147      if (this.type == null) {
148        this.type =
149            new EnumWrapper<AiAgentExtractStructuredTypeField>(
150                AiAgentExtractStructuredTypeField.AI_AGENT_EXTRACT_STRUCTURED);
151      }
152      return new AiAgentExtractStructured(this);
153    }
154  }
155}