001package com.box.sdkgen.schemas.aiagentextract;
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 extraction. */
015@JsonFilter("nullablePropertyFilter")
016public class AiAgentExtract extends SerializableObject {
017
018  /** The type of AI agent to be used for extraction. */
019  @JsonDeserialize(using = AiAgentExtractTypeField.AiAgentExtractTypeFieldDeserializer.class)
020  @JsonSerialize(using = AiAgentExtractTypeField.AiAgentExtractTypeFieldSerializer.class)
021  protected EnumWrapper<AiAgentExtractTypeField> type;
022
023  @JsonProperty("long_text")
024  protected AiAgentLongTextTool longText;
025
026  @JsonProperty("basic_text")
027  protected AiAgentBasicTextTool basicText;
028
029  @JsonProperty("basic_image")
030  protected AiAgentBasicTextTool basicImage;
031
032  public AiAgentExtract() {
033    super();
034    this.type = new EnumWrapper<AiAgentExtractTypeField>(AiAgentExtractTypeField.AI_AGENT_EXTRACT);
035  }
036
037  protected AiAgentExtract(Builder builder) {
038    super();
039    this.type = builder.type;
040    this.longText = builder.longText;
041    this.basicText = builder.basicText;
042    this.basicImage = builder.basicImage;
043    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
044  }
045
046  public EnumWrapper<AiAgentExtractTypeField> getType() {
047    return type;
048  }
049
050  public AiAgentLongTextTool getLongText() {
051    return longText;
052  }
053
054  public AiAgentBasicTextTool getBasicText() {
055    return basicText;
056  }
057
058  public AiAgentBasicTextTool getBasicImage() {
059    return basicImage;
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    AiAgentExtract casted = (AiAgentExtract) o;
071    return Objects.equals(type, casted.type)
072        && Objects.equals(longText, casted.longText)
073        && Objects.equals(basicText, casted.basicText)
074        && Objects.equals(basicImage, casted.basicImage);
075  }
076
077  @Override
078  public int hashCode() {
079    return Objects.hash(type, longText, basicText, basicImage);
080  }
081
082  @Override
083  public String toString() {
084    return "AiAgentExtract{"
085        + "type='"
086        + type
087        + '\''
088        + ", "
089        + "longText='"
090        + longText
091        + '\''
092        + ", "
093        + "basicText='"
094        + basicText
095        + '\''
096        + ", "
097        + "basicImage='"
098        + basicImage
099        + '\''
100        + "}";
101  }
102
103  public static class Builder extends NullableFieldTracker {
104
105    protected EnumWrapper<AiAgentExtractTypeField> type;
106
107    protected AiAgentLongTextTool longText;
108
109    protected AiAgentBasicTextTool basicText;
110
111    protected AiAgentBasicTextTool basicImage;
112
113    public Builder() {
114      super();
115    }
116
117    public Builder type(AiAgentExtractTypeField type) {
118      this.type = new EnumWrapper<AiAgentExtractTypeField>(type);
119      return this;
120    }
121
122    public Builder type(EnumWrapper<AiAgentExtractTypeField> type) {
123      this.type = type;
124      return this;
125    }
126
127    public Builder longText(AiAgentLongTextTool longText) {
128      this.longText = longText;
129      return this;
130    }
131
132    public Builder basicText(AiAgentBasicTextTool basicText) {
133      this.basicText = basicText;
134      return this;
135    }
136
137    public Builder basicImage(AiAgentBasicTextTool basicImage) {
138      this.basicImage = basicImage;
139      return this;
140    }
141
142    public AiAgentExtract build() {
143      if (this.type == null) {
144        this.type =
145            new EnumWrapper<AiAgentExtractTypeField>(AiAgentExtractTypeField.AI_AGENT_EXTRACT);
146      }
147      return new AiAgentExtract(this);
148    }
149  }
150}