001package com.box.sdkgen.schemas.v2025r0.weblinkreferencev2025r0;
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/** Web link reference. */
013@JsonFilter("nullablePropertyFilter")
014public class WeblinkReferenceV2025R0 extends SerializableObject {
015
016  /** The value will always be `web_link`. */
017  @JsonDeserialize(
018      using = WeblinkReferenceV2025R0TypeField.WeblinkReferenceV2025R0TypeFieldDeserializer.class)
019  @JsonSerialize(
020      using = WeblinkReferenceV2025R0TypeField.WeblinkReferenceV2025R0TypeFieldSerializer.class)
021  protected EnumWrapper<WeblinkReferenceV2025R0TypeField> type;
022
023  /** ID of the web link. */
024  protected final String id;
025
026  public WeblinkReferenceV2025R0(@JsonProperty("id") String id) {
027    super();
028    this.id = id;
029    this.type =
030        new EnumWrapper<WeblinkReferenceV2025R0TypeField>(
031            WeblinkReferenceV2025R0TypeField.WEB_LINK);
032  }
033
034  protected WeblinkReferenceV2025R0(Builder builder) {
035    super();
036    this.type = builder.type;
037    this.id = builder.id;
038    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
039  }
040
041  public EnumWrapper<WeblinkReferenceV2025R0TypeField> getType() {
042    return type;
043  }
044
045  public String getId() {
046    return id;
047  }
048
049  @Override
050  public boolean equals(Object o) {
051    if (this == o) {
052      return true;
053    }
054    if (o == null || getClass() != o.getClass()) {
055      return false;
056    }
057    WeblinkReferenceV2025R0 casted = (WeblinkReferenceV2025R0) o;
058    return Objects.equals(type, casted.type) && Objects.equals(id, casted.id);
059  }
060
061  @Override
062  public int hashCode() {
063    return Objects.hash(type, id);
064  }
065
066  @Override
067  public String toString() {
068    return "WeblinkReferenceV2025R0{" + "type='" + type + '\'' + ", " + "id='" + id + '\'' + "}";
069  }
070
071  public static class Builder extends NullableFieldTracker {
072
073    protected EnumWrapper<WeblinkReferenceV2025R0TypeField> type;
074
075    protected final String id;
076
077    public Builder(String id) {
078      super();
079      this.id = id;
080    }
081
082    public Builder type(WeblinkReferenceV2025R0TypeField type) {
083      this.type = new EnumWrapper<WeblinkReferenceV2025R0TypeField>(type);
084      return this;
085    }
086
087    public Builder type(EnumWrapper<WeblinkReferenceV2025R0TypeField> type) {
088      this.type = type;
089      return this;
090    }
091
092    public WeblinkReferenceV2025R0 build() {
093      if (this.type == null) {
094        this.type =
095            new EnumWrapper<WeblinkReferenceV2025R0TypeField>(
096                WeblinkReferenceV2025R0TypeField.WEB_LINK);
097      }
098      return new WeblinkReferenceV2025R0(this);
099    }
100  }
101}