001package com.box.sdkgen.managers.skills;
002
003import com.box.sdkgen.internal.NullableFieldTracker;
004import com.box.sdkgen.internal.SerializableObject;
005import com.box.sdkgen.schemas.keywordskillcard.KeywordSkillCard;
006import com.box.sdkgen.schemas.skillcard.SkillCard;
007import com.box.sdkgen.schemas.statusskillcard.StatusSkillCard;
008import com.box.sdkgen.schemas.timelineskillcard.TimelineSkillCard;
009import com.box.sdkgen.schemas.transcriptskillcard.TranscriptSkillCard;
010import com.box.sdkgen.serialization.json.EnumWrapper;
011import com.fasterxml.jackson.annotation.JsonFilter;
012import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
013import com.fasterxml.jackson.databind.annotation.JsonSerialize;
014import java.util.Objects;
015
016@JsonFilter("nullablePropertyFilter")
017public class UpdateBoxSkillCardsOnFileRequestBody extends SerializableObject {
018
019  /** The value will always be `replace`. */
020  @JsonDeserialize(
021      using =
022          UpdateBoxSkillCardsOnFileRequestBodyOpField
023              .UpdateBoxSkillCardsOnFileRequestBodyOpFieldDeserializer.class)
024  @JsonSerialize(
025      using =
026          UpdateBoxSkillCardsOnFileRequestBodyOpField
027              .UpdateBoxSkillCardsOnFileRequestBodyOpFieldSerializer.class)
028  protected EnumWrapper<UpdateBoxSkillCardsOnFileRequestBodyOpField> op;
029
030  /**
031   * The JSON Path that represents the card to replace. In most cases this will be in the format
032   * `/cards/{index}` where `index` is the zero-indexed position of the card in the list of cards.
033   */
034  protected String path;
035
036  protected SkillCard value;
037
038  public UpdateBoxSkillCardsOnFileRequestBody() {
039    super();
040  }
041
042  protected UpdateBoxSkillCardsOnFileRequestBody(Builder builder) {
043    super();
044    this.op = builder.op;
045    this.path = builder.path;
046    this.value = builder.value;
047    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
048  }
049
050  public EnumWrapper<UpdateBoxSkillCardsOnFileRequestBodyOpField> getOp() {
051    return op;
052  }
053
054  public String getPath() {
055    return path;
056  }
057
058  public SkillCard getValue() {
059    return value;
060  }
061
062  @Override
063  public boolean equals(Object o) {
064    if (this == o) {
065      return true;
066    }
067    if (o == null || getClass() != o.getClass()) {
068      return false;
069    }
070    UpdateBoxSkillCardsOnFileRequestBody casted = (UpdateBoxSkillCardsOnFileRequestBody) o;
071    return Objects.equals(op, casted.op)
072        && Objects.equals(path, casted.path)
073        && Objects.equals(value, casted.value);
074  }
075
076  @Override
077  public int hashCode() {
078    return Objects.hash(op, path, value);
079  }
080
081  @Override
082  public String toString() {
083    return "UpdateBoxSkillCardsOnFileRequestBody{"
084        + "op='"
085        + op
086        + '\''
087        + ", "
088        + "path='"
089        + path
090        + '\''
091        + ", "
092        + "value='"
093        + value
094        + '\''
095        + "}";
096  }
097
098  public static class Builder extends NullableFieldTracker {
099
100    protected EnumWrapper<UpdateBoxSkillCardsOnFileRequestBodyOpField> op;
101
102    protected String path;
103
104    protected SkillCard value;
105
106    public Builder op(UpdateBoxSkillCardsOnFileRequestBodyOpField op) {
107      this.op = new EnumWrapper<UpdateBoxSkillCardsOnFileRequestBodyOpField>(op);
108      return this;
109    }
110
111    public Builder op(EnumWrapper<UpdateBoxSkillCardsOnFileRequestBodyOpField> op) {
112      this.op = op;
113      return this;
114    }
115
116    public Builder path(String path) {
117      this.path = path;
118      return this;
119    }
120
121    public Builder value(KeywordSkillCard value) {
122      this.value = new SkillCard(value);
123      return this;
124    }
125
126    public Builder value(TimelineSkillCard value) {
127      this.value = new SkillCard(value);
128      return this;
129    }
130
131    public Builder value(TranscriptSkillCard value) {
132      this.value = new SkillCard(value);
133      return this;
134    }
135
136    public Builder value(StatusSkillCard value) {
137      this.value = new SkillCard(value);
138      return this;
139    }
140
141    public Builder value(SkillCard value) {
142      this.value = value;
143      return this;
144    }
145
146    public UpdateBoxSkillCardsOnFileRequestBody build() {
147      return new UpdateBoxSkillCardsOnFileRequestBody(this);
148    }
149  }
150}