001package com.box.sdkgen.schemas.shieldinformationbarriersegment;
002
003import com.box.sdkgen.internal.NullableFieldTracker;
004import com.box.sdkgen.internal.SerializableObject;
005import com.box.sdkgen.internal.utils.DateTimeUtils;
006import com.box.sdkgen.schemas.shieldinformationbarrierbase.ShieldInformationBarrierBase;
007import com.box.sdkgen.schemas.userbase.UserBase;
008import com.box.sdkgen.serialization.json.EnumWrapper;
009import com.fasterxml.jackson.annotation.JsonFilter;
010import com.fasterxml.jackson.annotation.JsonProperty;
011import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
012import com.fasterxml.jackson.databind.annotation.JsonSerialize;
013import java.time.OffsetDateTime;
014import java.util.Objects;
015
016/** A shield information barrier segment object. */
017@JsonFilter("nullablePropertyFilter")
018public class ShieldInformationBarrierSegment extends SerializableObject {
019
020  /** The unique identifier for the shield information barrier segment. */
021  protected String id;
022
023  /** The type of the shield information barrier segment. */
024  @JsonDeserialize(
025      using =
026          ShieldInformationBarrierSegmentTypeField
027              .ShieldInformationBarrierSegmentTypeFieldDeserializer.class)
028  @JsonSerialize(
029      using =
030          ShieldInformationBarrierSegmentTypeField
031              .ShieldInformationBarrierSegmentTypeFieldSerializer.class)
032  protected EnumWrapper<ShieldInformationBarrierSegmentTypeField> type;
033
034  @JsonProperty("shield_information_barrier")
035  protected ShieldInformationBarrierBase shieldInformationBarrier;
036
037  /** Name of the shield information barrier segment. */
038  protected String name;
039
040  /** Description of the shield information barrier segment. */
041  protected String description;
042
043  /** ISO date time string when this shield information barrier object was created. */
044  @JsonProperty("created_at")
045  @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class)
046  @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class)
047  protected OffsetDateTime createdAt;
048
049  @JsonProperty("created_by")
050  protected UserBase createdBy;
051
052  /** ISO date time string when this shield information barrier segment was updated. */
053  @JsonProperty("updated_at")
054  @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class)
055  @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class)
056  protected OffsetDateTime updatedAt;
057
058  @JsonProperty("updated_by")
059  protected UserBase updatedBy;
060
061  public ShieldInformationBarrierSegment() {
062    super();
063  }
064
065  protected ShieldInformationBarrierSegment(Builder builder) {
066    super();
067    this.id = builder.id;
068    this.type = builder.type;
069    this.shieldInformationBarrier = builder.shieldInformationBarrier;
070    this.name = builder.name;
071    this.description = builder.description;
072    this.createdAt = builder.createdAt;
073    this.createdBy = builder.createdBy;
074    this.updatedAt = builder.updatedAt;
075    this.updatedBy = builder.updatedBy;
076    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
077  }
078
079  public String getId() {
080    return id;
081  }
082
083  public EnumWrapper<ShieldInformationBarrierSegmentTypeField> getType() {
084    return type;
085  }
086
087  public ShieldInformationBarrierBase getShieldInformationBarrier() {
088    return shieldInformationBarrier;
089  }
090
091  public String getName() {
092    return name;
093  }
094
095  public String getDescription() {
096    return description;
097  }
098
099  public OffsetDateTime getCreatedAt() {
100    return createdAt;
101  }
102
103  public UserBase getCreatedBy() {
104    return createdBy;
105  }
106
107  public OffsetDateTime getUpdatedAt() {
108    return updatedAt;
109  }
110
111  public UserBase getUpdatedBy() {
112    return updatedBy;
113  }
114
115  @Override
116  public boolean equals(Object o) {
117    if (this == o) {
118      return true;
119    }
120    if (o == null || getClass() != o.getClass()) {
121      return false;
122    }
123    ShieldInformationBarrierSegment casted = (ShieldInformationBarrierSegment) o;
124    return Objects.equals(id, casted.id)
125        && Objects.equals(type, casted.type)
126        && Objects.equals(shieldInformationBarrier, casted.shieldInformationBarrier)
127        && Objects.equals(name, casted.name)
128        && Objects.equals(description, casted.description)
129        && Objects.equals(createdAt, casted.createdAt)
130        && Objects.equals(createdBy, casted.createdBy)
131        && Objects.equals(updatedAt, casted.updatedAt)
132        && Objects.equals(updatedBy, casted.updatedBy);
133  }
134
135  @Override
136  public int hashCode() {
137    return Objects.hash(
138        id,
139        type,
140        shieldInformationBarrier,
141        name,
142        description,
143        createdAt,
144        createdBy,
145        updatedAt,
146        updatedBy);
147  }
148
149  @Override
150  public String toString() {
151    return "ShieldInformationBarrierSegment{"
152        + "id='"
153        + id
154        + '\''
155        + ", "
156        + "type='"
157        + type
158        + '\''
159        + ", "
160        + "shieldInformationBarrier='"
161        + shieldInformationBarrier
162        + '\''
163        + ", "
164        + "name='"
165        + name
166        + '\''
167        + ", "
168        + "description='"
169        + description
170        + '\''
171        + ", "
172        + "createdAt='"
173        + createdAt
174        + '\''
175        + ", "
176        + "createdBy='"
177        + createdBy
178        + '\''
179        + ", "
180        + "updatedAt='"
181        + updatedAt
182        + '\''
183        + ", "
184        + "updatedBy='"
185        + updatedBy
186        + '\''
187        + "}";
188  }
189
190  public static class Builder extends NullableFieldTracker {
191
192    protected String id;
193
194    protected EnumWrapper<ShieldInformationBarrierSegmentTypeField> type;
195
196    protected ShieldInformationBarrierBase shieldInformationBarrier;
197
198    protected String name;
199
200    protected String description;
201
202    protected OffsetDateTime createdAt;
203
204    protected UserBase createdBy;
205
206    protected OffsetDateTime updatedAt;
207
208    protected UserBase updatedBy;
209
210    public Builder id(String id) {
211      this.id = id;
212      return this;
213    }
214
215    public Builder type(ShieldInformationBarrierSegmentTypeField type) {
216      this.type = new EnumWrapper<ShieldInformationBarrierSegmentTypeField>(type);
217      return this;
218    }
219
220    public Builder type(EnumWrapper<ShieldInformationBarrierSegmentTypeField> type) {
221      this.type = type;
222      return this;
223    }
224
225    public Builder shieldInformationBarrier(ShieldInformationBarrierBase shieldInformationBarrier) {
226      this.shieldInformationBarrier = shieldInformationBarrier;
227      return this;
228    }
229
230    public Builder name(String name) {
231      this.name = name;
232      return this;
233    }
234
235    public Builder description(String description) {
236      this.description = description;
237      return this;
238    }
239
240    public Builder createdAt(OffsetDateTime createdAt) {
241      this.createdAt = createdAt;
242      return this;
243    }
244
245    public Builder createdBy(UserBase createdBy) {
246      this.createdBy = createdBy;
247      return this;
248    }
249
250    public Builder updatedAt(OffsetDateTime updatedAt) {
251      this.updatedAt = updatedAt;
252      return this;
253    }
254
255    public Builder updatedBy(UserBase updatedBy) {
256      this.updatedBy = updatedBy;
257      return this;
258    }
259
260    public ShieldInformationBarrierSegment build() {
261      return new ShieldInformationBarrierSegment(this);
262    }
263  }
264}