001package com.box.sdkgen.schemas.v2025r0.groupminiv2025r0;
002
003import com.box.sdkgen.schemas.v2025r0.groupbasev2025r0.GroupBaseV2025R0;
004import com.box.sdkgen.schemas.v2025r0.groupbasev2025r0.GroupBaseV2025R0TypeField;
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/** Mini representation of a group, including id and name of group. */
013@JsonFilter("nullablePropertyFilter")
014public class GroupMiniV2025R0 extends GroupBaseV2025R0 {
015
016  /** The name of the group. */
017  protected String name;
018
019  /** The type of the group. */
020  @JsonDeserialize(
021      using = GroupMiniV2025R0GroupTypeField.GroupMiniV2025R0GroupTypeFieldDeserializer.class)
022  @JsonSerialize(
023      using = GroupMiniV2025R0GroupTypeField.GroupMiniV2025R0GroupTypeFieldSerializer.class)
024  @JsonProperty("group_type")
025  protected EnumWrapper<GroupMiniV2025R0GroupTypeField> groupType;
026
027  public GroupMiniV2025R0(@JsonProperty("id") String id) {
028    super(id);
029  }
030
031  protected GroupMiniV2025R0(Builder builder) {
032    super(builder);
033    this.name = builder.name;
034    this.groupType = builder.groupType;
035    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
036  }
037
038  public String getName() {
039    return name;
040  }
041
042  public EnumWrapper<GroupMiniV2025R0GroupTypeField> getGroupType() {
043    return groupType;
044  }
045
046  @Override
047  public boolean equals(Object o) {
048    if (this == o) {
049      return true;
050    }
051    if (o == null || getClass() != o.getClass()) {
052      return false;
053    }
054    GroupMiniV2025R0 casted = (GroupMiniV2025R0) o;
055    return Objects.equals(id, casted.id)
056        && Objects.equals(type, casted.type)
057        && Objects.equals(name, casted.name)
058        && Objects.equals(groupType, casted.groupType);
059  }
060
061  @Override
062  public int hashCode() {
063    return Objects.hash(id, type, name, groupType);
064  }
065
066  @Override
067  public String toString() {
068    return "GroupMiniV2025R0{"
069        + "id='"
070        + id
071        + '\''
072        + ", "
073        + "type='"
074        + type
075        + '\''
076        + ", "
077        + "name='"
078        + name
079        + '\''
080        + ", "
081        + "groupType='"
082        + groupType
083        + '\''
084        + "}";
085  }
086
087  public static class Builder extends GroupBaseV2025R0.Builder {
088
089    protected String name;
090
091    protected EnumWrapper<GroupMiniV2025R0GroupTypeField> groupType;
092
093    public Builder(String id) {
094      super(id);
095    }
096
097    public Builder name(String name) {
098      this.name = name;
099      return this;
100    }
101
102    public Builder groupType(GroupMiniV2025R0GroupTypeField groupType) {
103      this.groupType = new EnumWrapper<GroupMiniV2025R0GroupTypeField>(groupType);
104      return this;
105    }
106
107    public Builder groupType(EnumWrapper<GroupMiniV2025R0GroupTypeField> groupType) {
108      this.groupType = groupType;
109      return this;
110    }
111
112    @Override
113    public Builder type(GroupBaseV2025R0TypeField type) {
114      this.type = new EnumWrapper<GroupBaseV2025R0TypeField>(type);
115      return this;
116    }
117
118    @Override
119    public Builder type(EnumWrapper<GroupBaseV2025R0TypeField> type) {
120      this.type = type;
121      return this;
122    }
123
124    public GroupMiniV2025R0 build() {
125      if (this.type == null) {
126        this.type = new EnumWrapper<GroupBaseV2025R0TypeField>(GroupBaseV2025R0TypeField.GROUP);
127      }
128      return new GroupMiniV2025R0(this);
129    }
130  }
131}