001package com.box.sdkgen.schemas.aistudioagenttextgen;
002
003import com.box.sdkgen.internal.Nullable;
004import com.box.sdkgen.internal.NullableFieldTracker;
005import com.box.sdkgen.internal.SerializableObject;
006import com.box.sdkgen.schemas.aistudioagentbasicgentool.AiStudioAgentBasicGenTool;
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.List;
013import java.util.Objects;
014
015/** The AI agent to be used to generate text. */
016@JsonFilter("nullablePropertyFilter")
017public class AiStudioAgentTextGen extends SerializableObject {
018
019  /** The type of AI agent used for generating text. */
020  @JsonDeserialize(
021      using = AiStudioAgentTextGenTypeField.AiStudioAgentTextGenTypeFieldDeserializer.class)
022  @JsonSerialize(
023      using = AiStudioAgentTextGenTypeField.AiStudioAgentTextGenTypeFieldSerializer.class)
024  protected EnumWrapper<AiStudioAgentTextGenTypeField> type;
025
026  /** The state of the AI Agent capability. Possible values are: `enabled` and `disabled`. */
027  @JsonProperty("access_state")
028  protected final String accessState;
029
030  /** The description of the AI agent. */
031  protected final String description;
032
033  /** Custom instructions for the AI agent. */
034  @JsonProperty("custom_instructions")
035  @Nullable
036  protected String customInstructions;
037
038  /**
039   * Suggested questions for the AI agent. If null, suggested question will be generated. If empty,
040   * no suggested questions will be displayed.
041   */
042  @JsonProperty("suggested_questions")
043  protected List<String> suggestedQuestions;
044
045  @JsonProperty("basic_gen")
046  protected AiStudioAgentBasicGenTool basicGen;
047
048  public AiStudioAgentTextGen(
049      @JsonProperty("access_state") String accessState,
050      @JsonProperty("description") String description) {
051    super();
052    this.accessState = accessState;
053    this.description = description;
054    this.type =
055        new EnumWrapper<AiStudioAgentTextGenTypeField>(
056            AiStudioAgentTextGenTypeField.AI_AGENT_TEXT_GEN);
057  }
058
059  protected AiStudioAgentTextGen(Builder builder) {
060    super();
061    this.type = builder.type;
062    this.accessState = builder.accessState;
063    this.description = builder.description;
064    this.customInstructions = builder.customInstructions;
065    this.suggestedQuestions = builder.suggestedQuestions;
066    this.basicGen = builder.basicGen;
067    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
068  }
069
070  public EnumWrapper<AiStudioAgentTextGenTypeField> getType() {
071    return type;
072  }
073
074  public String getAccessState() {
075    return accessState;
076  }
077
078  public String getDescription() {
079    return description;
080  }
081
082  public String getCustomInstructions() {
083    return customInstructions;
084  }
085
086  public List<String> getSuggestedQuestions() {
087    return suggestedQuestions;
088  }
089
090  public AiStudioAgentBasicGenTool getBasicGen() {
091    return basicGen;
092  }
093
094  @Override
095  public boolean equals(Object o) {
096    if (this == o) {
097      return true;
098    }
099    if (o == null || getClass() != o.getClass()) {
100      return false;
101    }
102    AiStudioAgentTextGen casted = (AiStudioAgentTextGen) o;
103    return Objects.equals(type, casted.type)
104        && Objects.equals(accessState, casted.accessState)
105        && Objects.equals(description, casted.description)
106        && Objects.equals(customInstructions, casted.customInstructions)
107        && Objects.equals(suggestedQuestions, casted.suggestedQuestions)
108        && Objects.equals(basicGen, casted.basicGen);
109  }
110
111  @Override
112  public int hashCode() {
113    return Objects.hash(
114        type, accessState, description, customInstructions, suggestedQuestions, basicGen);
115  }
116
117  @Override
118  public String toString() {
119    return "AiStudioAgentTextGen{"
120        + "type='"
121        + type
122        + '\''
123        + ", "
124        + "accessState='"
125        + accessState
126        + '\''
127        + ", "
128        + "description='"
129        + description
130        + '\''
131        + ", "
132        + "customInstructions='"
133        + customInstructions
134        + '\''
135        + ", "
136        + "suggestedQuestions='"
137        + suggestedQuestions
138        + '\''
139        + ", "
140        + "basicGen='"
141        + basicGen
142        + '\''
143        + "}";
144  }
145
146  public static class Builder extends NullableFieldTracker {
147
148    protected EnumWrapper<AiStudioAgentTextGenTypeField> type;
149
150    protected final String accessState;
151
152    protected final String description;
153
154    protected String customInstructions;
155
156    protected List<String> suggestedQuestions;
157
158    protected AiStudioAgentBasicGenTool basicGen;
159
160    public Builder(String accessState, String description) {
161      super();
162      this.accessState = accessState;
163      this.description = description;
164    }
165
166    public Builder type(AiStudioAgentTextGenTypeField type) {
167      this.type = new EnumWrapper<AiStudioAgentTextGenTypeField>(type);
168      return this;
169    }
170
171    public Builder type(EnumWrapper<AiStudioAgentTextGenTypeField> type) {
172      this.type = type;
173      return this;
174    }
175
176    public Builder customInstructions(String customInstructions) {
177      this.customInstructions = customInstructions;
178      this.markNullableFieldAsSet("custom_instructions");
179      return this;
180    }
181
182    public Builder suggestedQuestions(List<String> suggestedQuestions) {
183      this.suggestedQuestions = suggestedQuestions;
184      return this;
185    }
186
187    public Builder basicGen(AiStudioAgentBasicGenTool basicGen) {
188      this.basicGen = basicGen;
189      return this;
190    }
191
192    public AiStudioAgentTextGen build() {
193      if (this.type == null) {
194        this.type =
195            new EnumWrapper<AiStudioAgentTextGenTypeField>(
196                AiStudioAgentTextGenTypeField.AI_AGENT_TEXT_GEN);
197      }
198      return new AiStudioAgentTextGen(this);
199    }
200  }
201}