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