001package com.box.sdkgen.schemas.v2025r0.hubbasev2025r0;
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/** The bare basic representation of a Box Hub. */
013@JsonFilter("nullablePropertyFilter")
014public class HubBaseV2025R0 extends SerializableObject {
015
016  /**
017   * The unique identifier that represent a Box Hub.
018   *
019   * <p>The ID for any Box Hub can be determined by visiting a Box Hub in the web application and
020   * copying the ID from the URL. For example, for the URL `https://*.app.box.com/hubs/123` the
021   * `hub_id` is `123`.
022   */
023  protected final String id;
024
025  /** The value will always be `hubs`. */
026  @JsonDeserialize(using = HubBaseV2025R0TypeField.HubBaseV2025R0TypeFieldDeserializer.class)
027  @JsonSerialize(using = HubBaseV2025R0TypeField.HubBaseV2025R0TypeFieldSerializer.class)
028  protected EnumWrapper<HubBaseV2025R0TypeField> type;
029
030  public HubBaseV2025R0(@JsonProperty("id") String id) {
031    super();
032    this.id = id;
033    this.type = new EnumWrapper<HubBaseV2025R0TypeField>(HubBaseV2025R0TypeField.HUBS);
034  }
035
036  protected HubBaseV2025R0(Builder builder) {
037    super();
038    this.id = builder.id;
039    this.type = builder.type;
040    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
041  }
042
043  public String getId() {
044    return id;
045  }
046
047  public EnumWrapper<HubBaseV2025R0TypeField> getType() {
048    return type;
049  }
050
051  @Override
052  public boolean equals(Object o) {
053    if (this == o) {
054      return true;
055    }
056    if (o == null || getClass() != o.getClass()) {
057      return false;
058    }
059    HubBaseV2025R0 casted = (HubBaseV2025R0) o;
060    return Objects.equals(id, casted.id) && Objects.equals(type, casted.type);
061  }
062
063  @Override
064  public int hashCode() {
065    return Objects.hash(id, type);
066  }
067
068  @Override
069  public String toString() {
070    return "HubBaseV2025R0{" + "id='" + id + '\'' + ", " + "type='" + type + '\'' + "}";
071  }
072
073  public static class Builder extends NullableFieldTracker {
074
075    protected final String id;
076
077    protected EnumWrapper<HubBaseV2025R0TypeField> type;
078
079    public Builder(String id) {
080      super();
081      this.id = id;
082    }
083
084    public Builder type(HubBaseV2025R0TypeField type) {
085      this.type = new EnumWrapper<HubBaseV2025R0TypeField>(type);
086      return this;
087    }
088
089    public Builder type(EnumWrapper<HubBaseV2025R0TypeField> type) {
090      this.type = type;
091      return this;
092    }
093
094    public HubBaseV2025R0 build() {
095      if (this.type == null) {
096        this.type = new EnumWrapper<HubBaseV2025R0TypeField>(HubBaseV2025R0TypeField.HUBS);
097      }
098      return new HubBaseV2025R0(this);
099    }
100  }
101}