001package com.box.sdkgen.managers.fileversions;
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.databind.annotation.JsonDeserialize;
008import com.fasterxml.jackson.databind.annotation.JsonSerialize;
009import java.util.Objects;
010
011@JsonFilter("nullablePropertyFilter")
012public class PromoteFileVersionRequestBody extends SerializableObject {
013
014  /** The file version ID. */
015  protected String id;
016
017  /** The type to promote. */
018  @JsonDeserialize(
019      using =
020          PromoteFileVersionRequestBodyTypeField.PromoteFileVersionRequestBodyTypeFieldDeserializer
021              .class)
022  @JsonSerialize(
023      using =
024          PromoteFileVersionRequestBodyTypeField.PromoteFileVersionRequestBodyTypeFieldSerializer
025              .class)
026  protected EnumWrapper<PromoteFileVersionRequestBodyTypeField> type;
027
028  public PromoteFileVersionRequestBody() {
029    super();
030  }
031
032  protected PromoteFileVersionRequestBody(Builder builder) {
033    super();
034    this.id = builder.id;
035    this.type = builder.type;
036    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
037  }
038
039  public String getId() {
040    return id;
041  }
042
043  public EnumWrapper<PromoteFileVersionRequestBodyTypeField> getType() {
044    return type;
045  }
046
047  @Override
048  public boolean equals(Object o) {
049    if (this == o) {
050      return true;
051    }
052    if (o == null || getClass() != o.getClass()) {
053      return false;
054    }
055    PromoteFileVersionRequestBody casted = (PromoteFileVersionRequestBody) o;
056    return Objects.equals(id, casted.id) && Objects.equals(type, casted.type);
057  }
058
059  @Override
060  public int hashCode() {
061    return Objects.hash(id, type);
062  }
063
064  @Override
065  public String toString() {
066    return "PromoteFileVersionRequestBody{"
067        + "id='"
068        + id
069        + '\''
070        + ", "
071        + "type='"
072        + type
073        + '\''
074        + "}";
075  }
076
077  public static class Builder extends NullableFieldTracker {
078
079    protected String id;
080
081    protected EnumWrapper<PromoteFileVersionRequestBodyTypeField> type;
082
083    public Builder id(String id) {
084      this.id = id;
085      return this;
086    }
087
088    public Builder type(PromoteFileVersionRequestBodyTypeField type) {
089      this.type = new EnumWrapper<PromoteFileVersionRequestBodyTypeField>(type);
090      return this;
091    }
092
093    public Builder type(EnumWrapper<PromoteFileVersionRequestBodyTypeField> type) {
094      this.type = type;
095      return this;
096    }
097
098    public PromoteFileVersionRequestBody build() {
099      return new PromoteFileVersionRequestBody(this);
100    }
101  }
102}