001package com.box.sdkgen.schemas.aiitemask;
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/** The item to be processed by the LLM for ask requests. */
013@JsonFilter("nullablePropertyFilter")
014public class AiItemAsk extends SerializableObject {
015
016  /** The ID of the file, or the ID of the Box Hub when `type` is `hubs`. */
017  protected final String id;
018
019  /**
020   * The type of the item. Use `file` to ask a question about a file, or `hubs` to search across and
021   * ask a question about the entire contents of a Box Hub. A `hubs` item must be the only item in
022   * the request.
023   */
024  @JsonDeserialize(using = AiItemAskTypeField.AiItemAskTypeFieldDeserializer.class)
025  @JsonSerialize(using = AiItemAskTypeField.AiItemAskTypeFieldSerializer.class)
026  protected final EnumWrapper<AiItemAskTypeField> type;
027
028  /** The content of the item, often the text representation. */
029  protected String content;
030
031  public AiItemAsk(String id, AiItemAskTypeField type) {
032    super();
033    this.id = id;
034    this.type = new EnumWrapper<AiItemAskTypeField>(type);
035  }
036
037  public AiItemAsk(
038      @JsonProperty("id") String id, @JsonProperty("type") EnumWrapper<AiItemAskTypeField> type) {
039    super();
040    this.id = id;
041    this.type = type;
042  }
043
044  protected AiItemAsk(Builder builder) {
045    super();
046    this.id = builder.id;
047    this.type = builder.type;
048    this.content = builder.content;
049    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
050  }
051
052  public String getId() {
053    return id;
054  }
055
056  public EnumWrapper<AiItemAskTypeField> getType() {
057    return type;
058  }
059
060  public String getContent() {
061    return content;
062  }
063
064  @Override
065  public boolean equals(Object o) {
066    if (this == o) {
067      return true;
068    }
069    if (o == null || getClass() != o.getClass()) {
070      return false;
071    }
072    AiItemAsk casted = (AiItemAsk) o;
073    return Objects.equals(id, casted.id)
074        && Objects.equals(type, casted.type)
075        && Objects.equals(content, casted.content);
076  }
077
078  @Override
079  public int hashCode() {
080    return Objects.hash(id, type, content);
081  }
082
083  @Override
084  public String toString() {
085    return "AiItemAsk{"
086        + "id='"
087        + id
088        + '\''
089        + ", "
090        + "type='"
091        + type
092        + '\''
093        + ", "
094        + "content='"
095        + content
096        + '\''
097        + "}";
098  }
099
100  public static class Builder extends NullableFieldTracker {
101
102    protected final String id;
103
104    protected final EnumWrapper<AiItemAskTypeField> type;
105
106    protected String content;
107
108    public Builder(String id, AiItemAskTypeField type) {
109      super();
110      this.id = id;
111      this.type = new EnumWrapper<AiItemAskTypeField>(type);
112    }
113
114    public Builder(String id, EnumWrapper<AiItemAskTypeField> type) {
115      super();
116      this.id = id;
117      this.type = type;
118    }
119
120    public Builder content(String content) {
121      this.content = content;
122      return this;
123    }
124
125    public AiItemAsk build() {
126      return new AiItemAsk(this);
127    }
128  }
129}