001package com.box.sdkgen.schemas.v2025r0.userbasev2025r0;
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/** A mini representation of a user, used when nested within another resource. */
013@JsonFilter("nullablePropertyFilter")
014public class UserBaseV2025R0 extends SerializableObject {
015
016  /** The unique identifier for this user. */
017  protected final String id;
018
019  /** The value will always be `user`. */
020  @JsonDeserialize(using = UserBaseV2025R0TypeField.UserBaseV2025R0TypeFieldDeserializer.class)
021  @JsonSerialize(using = UserBaseV2025R0TypeField.UserBaseV2025R0TypeFieldSerializer.class)
022  protected EnumWrapper<UserBaseV2025R0TypeField> type;
023
024  public UserBaseV2025R0(@JsonProperty("id") String id) {
025    super();
026    this.id = id;
027    this.type = new EnumWrapper<UserBaseV2025R0TypeField>(UserBaseV2025R0TypeField.USER);
028  }
029
030  protected UserBaseV2025R0(Builder builder) {
031    super();
032    this.id = builder.id;
033    this.type = builder.type;
034    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
035  }
036
037  public String getId() {
038    return id;
039  }
040
041  public EnumWrapper<UserBaseV2025R0TypeField> getType() {
042    return type;
043  }
044
045  @Override
046  public boolean equals(Object o) {
047    if (this == o) {
048      return true;
049    }
050    if (o == null || getClass() != o.getClass()) {
051      return false;
052    }
053    UserBaseV2025R0 casted = (UserBaseV2025R0) o;
054    return Objects.equals(id, casted.id) && Objects.equals(type, casted.type);
055  }
056
057  @Override
058  public int hashCode() {
059    return Objects.hash(id, type);
060  }
061
062  @Override
063  public String toString() {
064    return "UserBaseV2025R0{" + "id='" + id + '\'' + ", " + "type='" + type + '\'' + "}";
065  }
066
067  public static class Builder extends NullableFieldTracker {
068
069    protected final String id;
070
071    protected EnumWrapper<UserBaseV2025R0TypeField> type;
072
073    public Builder(String id) {
074      super();
075      this.id = id;
076    }
077
078    public Builder type(UserBaseV2025R0TypeField type) {
079      this.type = new EnumWrapper<UserBaseV2025R0TypeField>(type);
080      return this;
081    }
082
083    public Builder type(EnumWrapper<UserBaseV2025R0TypeField> type) {
084      this.type = type;
085      return this;
086    }
087
088    public UserBaseV2025R0 build() {
089      if (this.type == null) {
090        this.type = new EnumWrapper<UserBaseV2025R0TypeField>(UserBaseV2025R0TypeField.USER);
091      }
092      return new UserBaseV2025R0(this);
093    }
094  }
095}