001package com.box.sdkgen.schemas.v2025r0.hubcollaborationuserv2025r0;
002
003import com.box.sdkgen.schemas.v2025r0.userbasev2025r0.UserBaseV2025R0;
004import com.box.sdkgen.schemas.v2025r0.userbasev2025r0.UserBaseV2025R0TypeField;
005import com.box.sdkgen.serialization.json.EnumWrapper;
006import com.fasterxml.jackson.annotation.JsonFilter;
007import com.fasterxml.jackson.annotation.JsonProperty;
008import java.util.Objects;
009
010/** A mini representation of a user, can be returned only when the status is `pending`. */
011@JsonFilter("nullablePropertyFilter")
012public class HubCollaborationUserV2025R0 extends UserBaseV2025R0 {
013
014  /**
015   * The display name of this user. If the collaboration status is `pending`, an empty string is
016   * returned.
017   */
018  protected String name;
019
020  /**
021   * The primary email address of this user. If the collaboration status is `pending`, an empty
022   * string is returned.
023   */
024  protected String login;
025
026  public HubCollaborationUserV2025R0(@JsonProperty("id") String id) {
027    super(id);
028  }
029
030  protected HubCollaborationUserV2025R0(Builder builder) {
031    super(builder);
032    this.name = builder.name;
033    this.login = builder.login;
034    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
035  }
036
037  public String getName() {
038    return name;
039  }
040
041  public String getLogin() {
042    return login;
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    HubCollaborationUserV2025R0 casted = (HubCollaborationUserV2025R0) o;
054    return Objects.equals(id, casted.id)
055        && Objects.equals(type, casted.type)
056        && Objects.equals(name, casted.name)
057        && Objects.equals(login, casted.login);
058  }
059
060  @Override
061  public int hashCode() {
062    return Objects.hash(id, type, name, login);
063  }
064
065  @Override
066  public String toString() {
067    return "HubCollaborationUserV2025R0{"
068        + "id='"
069        + id
070        + '\''
071        + ", "
072        + "type='"
073        + type
074        + '\''
075        + ", "
076        + "name='"
077        + name
078        + '\''
079        + ", "
080        + "login='"
081        + login
082        + '\''
083        + "}";
084  }
085
086  public static class Builder extends UserBaseV2025R0.Builder {
087
088    protected String name;
089
090    protected String login;
091
092    public Builder(String id) {
093      super(id);
094    }
095
096    public Builder name(String name) {
097      this.name = name;
098      return this;
099    }
100
101    public Builder login(String login) {
102      this.login = login;
103      return this;
104    }
105
106    @Override
107    public Builder type(UserBaseV2025R0TypeField type) {
108      this.type = new EnumWrapper<UserBaseV2025R0TypeField>(type);
109      return this;
110    }
111
112    @Override
113    public Builder type(EnumWrapper<UserBaseV2025R0TypeField> type) {
114      this.type = type;
115      return this;
116    }
117
118    public HubCollaborationUserV2025R0 build() {
119      if (this.type == null) {
120        this.type = new EnumWrapper<UserBaseV2025R0TypeField>(UserBaseV2025R0TypeField.USER);
121      }
122      return new HubCollaborationUserV2025R0(this);
123    }
124  }
125}