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