001package com.box.sdkgen.schemas.v2025r0.enterprisereferencev2025r0;
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/** A reference to an enterprise, used when nested within another resource. */
012@JsonFilter("nullablePropertyFilter")
013public class EnterpriseReferenceV2025R0 extends SerializableObject {
014
015  /** The unique identifier for this enterprise. */
016  protected String id;
017
018  /** The value will always be `enterprise`. */
019  @JsonDeserialize(
020      using =
021          EnterpriseReferenceV2025R0TypeField.EnterpriseReferenceV2025R0TypeFieldDeserializer.class)
022  @JsonSerialize(
023      using =
024          EnterpriseReferenceV2025R0TypeField.EnterpriseReferenceV2025R0TypeFieldSerializer.class)
025  protected EnumWrapper<EnterpriseReferenceV2025R0TypeField> type;
026
027  public EnterpriseReferenceV2025R0() {
028    super();
029  }
030
031  protected EnterpriseReferenceV2025R0(Builder builder) {
032    super();
033    this.id = builder.id;
034    this.type = builder.type;
035    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
036  }
037
038  public String getId() {
039    return id;
040  }
041
042  public EnumWrapper<EnterpriseReferenceV2025R0TypeField> getType() {
043    return type;
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    EnterpriseReferenceV2025R0 casted = (EnterpriseReferenceV2025R0) o;
055    return Objects.equals(id, casted.id) && Objects.equals(type, casted.type);
056  }
057
058  @Override
059  public int hashCode() {
060    return Objects.hash(id, type);
061  }
062
063  @Override
064  public String toString() {
065    return "EnterpriseReferenceV2025R0{" + "id='" + id + '\'' + ", " + "type='" + type + '\'' + "}";
066  }
067
068  public static class Builder extends NullableFieldTracker {
069
070    protected String id;
071
072    protected EnumWrapper<EnterpriseReferenceV2025R0TypeField> type;
073
074    public Builder id(String id) {
075      this.id = id;
076      return this;
077    }
078
079    public Builder type(EnterpriseReferenceV2025R0TypeField type) {
080      this.type = new EnumWrapper<EnterpriseReferenceV2025R0TypeField>(type);
081      return this;
082    }
083
084    public Builder type(EnumWrapper<EnterpriseReferenceV2025R0TypeField> type) {
085      this.type = type;
086      return this;
087    }
088
089    public EnterpriseReferenceV2025R0 build() {
090      return new EnterpriseReferenceV2025R0(this);
091    }
092  }
093}