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