001package com.box.sdkgen.schemas.v2026r0.userbasev2026r0; 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 UserBaseV2026R0 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 = UserBaseV2026R0TypeField.UserBaseV2026R0TypeFieldDeserializer.class) 021 @JsonSerialize(using = UserBaseV2026R0TypeField.UserBaseV2026R0TypeFieldSerializer.class) 022 protected EnumWrapper<UserBaseV2026R0TypeField> type; 023 024 public UserBaseV2026R0(@JsonProperty("id") String id) { 025 super(); 026 this.id = id; 027 this.type = new EnumWrapper<UserBaseV2026R0TypeField>(UserBaseV2026R0TypeField.USER); 028 } 029 030 protected UserBaseV2026R0(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<UserBaseV2026R0TypeField> 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 UserBaseV2026R0 casted = (UserBaseV2026R0) 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 "UserBaseV2026R0{" + "id='" + id + '\'' + ", " + "type='" + type + '\'' + "}"; 065 } 066 067 public static class Builder extends NullableFieldTracker { 068 069 protected final String id; 070 071 protected EnumWrapper<UserBaseV2026R0TypeField> type; 072 073 public Builder(String id) { 074 super(); 075 this.id = id; 076 } 077 078 public Builder type(UserBaseV2026R0TypeField type) { 079 this.type = new EnumWrapper<UserBaseV2026R0TypeField>(type); 080 return this; 081 } 082 083 public Builder type(EnumWrapper<UserBaseV2026R0TypeField> type) { 084 this.type = type; 085 return this; 086 } 087 088 public UserBaseV2026R0 build() { 089 if (this.type == null) { 090 this.type = new EnumWrapper<UserBaseV2026R0TypeField>(UserBaseV2026R0TypeField.USER); 091 } 092 return new UserBaseV2026R0(this); 093 } 094 } 095}