001package com.box.sdkgen.schemas.aisingleagentresponse;
002
003import com.box.sdkgen.internal.NullableFieldTracker;
004import com.box.sdkgen.internal.SerializableObject;
005import com.box.sdkgen.internal.utils.DateTimeUtils;
006import com.box.sdkgen.schemas.aiagentallowedentity.AiAgentAllowedEntity;
007import com.box.sdkgen.schemas.userbase.UserBase;
008import com.box.sdkgen.serialization.json.EnumWrapper;
009import com.fasterxml.jackson.annotation.JsonFilter;
010import com.fasterxml.jackson.annotation.JsonProperty;
011import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
012import com.fasterxml.jackson.databind.annotation.JsonSerialize;
013import java.time.OffsetDateTime;
014import java.util.List;
015import java.util.Objects;
016
017/** Standard representation of an AI Agent instance. */
018@JsonFilter("nullablePropertyFilter")
019public class AiSingleAgentResponse extends SerializableObject {
020
021  /** The unique identifier of the AI Agent. */
022  protected final String id;
023
024  /** The type of agent used to handle queries. */
025  @JsonDeserialize(
026      using = AiSingleAgentResponseTypeField.AiSingleAgentResponseTypeFieldDeserializer.class)
027  @JsonSerialize(
028      using = AiSingleAgentResponseTypeField.AiSingleAgentResponseTypeFieldSerializer.class)
029  protected EnumWrapper<AiSingleAgentResponseTypeField> type;
030
031  /** The provider of the AI Agent. */
032  protected final String origin;
033
034  /** The name of the AI Agent. */
035  protected final String name;
036
037  /**
038   * The state of the AI Agent. Possible values are: `enabled`, `disabled`, and
039   * `enabled_for_selected_users`.
040   */
041  @JsonProperty("access_state")
042  protected final String accessState;
043
044  /** The user who created this agent. */
045  @JsonProperty("created_by")
046  protected UserBase createdBy;
047
048  /** The ISO date-time formatted timestamp of when this AI agent was created. */
049  @JsonProperty("created_at")
050  @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class)
051  @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class)
052  protected OffsetDateTime createdAt;
053
054  /** The user who most recently modified this agent. */
055  @JsonProperty("modified_by")
056  protected UserBase modifiedBy;
057
058  /** The ISO date-time formatted timestamp of when this AI agent was recently modified. */
059  @JsonProperty("modified_at")
060  @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class)
061  @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class)
062  protected OffsetDateTime modifiedAt;
063
064  /** The icon reference of the AI Agent. */
065  @JsonProperty("icon_reference")
066  protected String iconReference;
067
068  /** List of allowed users or groups. */
069  @JsonProperty("allowed_entities")
070  protected List<AiAgentAllowedEntity> allowedEntities;
071
072  public AiSingleAgentResponse(
073      @JsonProperty("id") String id,
074      @JsonProperty("origin") String origin,
075      @JsonProperty("name") String name,
076      @JsonProperty("access_state") String accessState) {
077    super();
078    this.id = id;
079    this.origin = origin;
080    this.name = name;
081    this.accessState = accessState;
082  }
083
084  protected AiSingleAgentResponse(Builder builder) {
085    super();
086    this.id = builder.id;
087    this.type = builder.type;
088    this.origin = builder.origin;
089    this.name = builder.name;
090    this.accessState = builder.accessState;
091    this.createdBy = builder.createdBy;
092    this.createdAt = builder.createdAt;
093    this.modifiedBy = builder.modifiedBy;
094    this.modifiedAt = builder.modifiedAt;
095    this.iconReference = builder.iconReference;
096    this.allowedEntities = builder.allowedEntities;
097    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
098  }
099
100  public String getId() {
101    return id;
102  }
103
104  public EnumWrapper<AiSingleAgentResponseTypeField> getType() {
105    return type;
106  }
107
108  public String getOrigin() {
109    return origin;
110  }
111
112  public String getName() {
113    return name;
114  }
115
116  public String getAccessState() {
117    return accessState;
118  }
119
120  public UserBase getCreatedBy() {
121    return createdBy;
122  }
123
124  public OffsetDateTime getCreatedAt() {
125    return createdAt;
126  }
127
128  public UserBase getModifiedBy() {
129    return modifiedBy;
130  }
131
132  public OffsetDateTime getModifiedAt() {
133    return modifiedAt;
134  }
135
136  public String getIconReference() {
137    return iconReference;
138  }
139
140  public List<AiAgentAllowedEntity> getAllowedEntities() {
141    return allowedEntities;
142  }
143
144  @Override
145  public boolean equals(Object o) {
146    if (this == o) {
147      return true;
148    }
149    if (o == null || getClass() != o.getClass()) {
150      return false;
151    }
152    AiSingleAgentResponse casted = (AiSingleAgentResponse) o;
153    return Objects.equals(id, casted.id)
154        && Objects.equals(type, casted.type)
155        && Objects.equals(origin, casted.origin)
156        && Objects.equals(name, casted.name)
157        && Objects.equals(accessState, casted.accessState)
158        && Objects.equals(createdBy, casted.createdBy)
159        && Objects.equals(createdAt, casted.createdAt)
160        && Objects.equals(modifiedBy, casted.modifiedBy)
161        && Objects.equals(modifiedAt, casted.modifiedAt)
162        && Objects.equals(iconReference, casted.iconReference)
163        && Objects.equals(allowedEntities, casted.allowedEntities);
164  }
165
166  @Override
167  public int hashCode() {
168    return Objects.hash(
169        id,
170        type,
171        origin,
172        name,
173        accessState,
174        createdBy,
175        createdAt,
176        modifiedBy,
177        modifiedAt,
178        iconReference,
179        allowedEntities);
180  }
181
182  @Override
183  public String toString() {
184    return "AiSingleAgentResponse{"
185        + "id='"
186        + id
187        + '\''
188        + ", "
189        + "type='"
190        + type
191        + '\''
192        + ", "
193        + "origin='"
194        + origin
195        + '\''
196        + ", "
197        + "name='"
198        + name
199        + '\''
200        + ", "
201        + "accessState='"
202        + accessState
203        + '\''
204        + ", "
205        + "createdBy='"
206        + createdBy
207        + '\''
208        + ", "
209        + "createdAt='"
210        + createdAt
211        + '\''
212        + ", "
213        + "modifiedBy='"
214        + modifiedBy
215        + '\''
216        + ", "
217        + "modifiedAt='"
218        + modifiedAt
219        + '\''
220        + ", "
221        + "iconReference='"
222        + iconReference
223        + '\''
224        + ", "
225        + "allowedEntities='"
226        + allowedEntities
227        + '\''
228        + "}";
229  }
230
231  public static class Builder extends NullableFieldTracker {
232
233    protected final String id;
234
235    protected EnumWrapper<AiSingleAgentResponseTypeField> type;
236
237    protected final String origin;
238
239    protected final String name;
240
241    protected final String accessState;
242
243    protected UserBase createdBy;
244
245    protected OffsetDateTime createdAt;
246
247    protected UserBase modifiedBy;
248
249    protected OffsetDateTime modifiedAt;
250
251    protected String iconReference;
252
253    protected List<AiAgentAllowedEntity> allowedEntities;
254
255    public Builder(String id, String origin, String name, String accessState) {
256      super();
257      this.id = id;
258      this.origin = origin;
259      this.name = name;
260      this.accessState = accessState;
261    }
262
263    public Builder type(AiSingleAgentResponseTypeField type) {
264      this.type = new EnumWrapper<AiSingleAgentResponseTypeField>(type);
265      return this;
266    }
267
268    public Builder type(EnumWrapper<AiSingleAgentResponseTypeField> type) {
269      this.type = type;
270      return this;
271    }
272
273    public Builder createdBy(UserBase createdBy) {
274      this.createdBy = createdBy;
275      return this;
276    }
277
278    public Builder createdAt(OffsetDateTime createdAt) {
279      this.createdAt = createdAt;
280      return this;
281    }
282
283    public Builder modifiedBy(UserBase modifiedBy) {
284      this.modifiedBy = modifiedBy;
285      return this;
286    }
287
288    public Builder modifiedAt(OffsetDateTime modifiedAt) {
289      this.modifiedAt = modifiedAt;
290      return this;
291    }
292
293    public Builder iconReference(String iconReference) {
294      this.iconReference = iconReference;
295      return this;
296    }
297
298    public Builder allowedEntities(List<AiAgentAllowedEntity> allowedEntities) {
299      this.allowedEntities = allowedEntities;
300      return this;
301    }
302
303    public AiSingleAgentResponse build() {
304      return new AiSingleAgentResponse(this);
305    }
306  }
307}