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