001package com.box.sdkgen.schemas.shieldinformationbarrier;
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.enterprisebase.EnterpriseBase;
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 standard representation of a shield information barrier object. */
017@JsonFilter("nullablePropertyFilter")
018public class ShieldInformationBarrier extends SerializableObject {
019
020  /** The unique identifier for the shield information barrier. */
021  protected String id;
022
023  /** The type of the shield information barrier. */
024  @JsonDeserialize(
025      using = ShieldInformationBarrierTypeField.ShieldInformationBarrierTypeFieldDeserializer.class)
026  @JsonSerialize(
027      using = ShieldInformationBarrierTypeField.ShieldInformationBarrierTypeFieldSerializer.class)
028  protected EnumWrapper<ShieldInformationBarrierTypeField> type;
029
030  /** The `type` and `id` of enterprise this barrier is under. */
031  protected EnterpriseBase enterprise;
032
033  /** Status of the shield information barrier. */
034  @JsonDeserialize(
035      using =
036          ShieldInformationBarrierStatusField.ShieldInformationBarrierStatusFieldDeserializer.class)
037  @JsonSerialize(
038      using =
039          ShieldInformationBarrierStatusField.ShieldInformationBarrierStatusFieldSerializer.class)
040  protected EnumWrapper<ShieldInformationBarrierStatusField> status;
041
042  /** ISO date time string when this shield information barrier object was created. */
043  @JsonProperty("created_at")
044  @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class)
045  @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class)
046  protected OffsetDateTime createdAt;
047
048  /** The user who created this shield information barrier. */
049  @JsonProperty("created_by")
050  protected UserBase createdBy;
051
052  /** ISO date time string when this shield information barrier was updated. */
053  @JsonProperty("updated_at")
054  @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class)
055  @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class)
056  protected OffsetDateTime updatedAt;
057
058  /** The user that updated this shield information barrier. */
059  @JsonProperty("updated_by")
060  protected UserBase updatedBy;
061
062  /** ISO date time string when this shield information barrier was enabled. */
063  @JsonProperty("enabled_at")
064  @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class)
065  @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class)
066  protected OffsetDateTime enabledAt;
067
068  @JsonProperty("enabled_by")
069  protected UserBase enabledBy;
070
071  public ShieldInformationBarrier() {
072    super();
073  }
074
075  protected ShieldInformationBarrier(Builder builder) {
076    super();
077    this.id = builder.id;
078    this.type = builder.type;
079    this.enterprise = builder.enterprise;
080    this.status = builder.status;
081    this.createdAt = builder.createdAt;
082    this.createdBy = builder.createdBy;
083    this.updatedAt = builder.updatedAt;
084    this.updatedBy = builder.updatedBy;
085    this.enabledAt = builder.enabledAt;
086    this.enabledBy = builder.enabledBy;
087    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
088  }
089
090  public String getId() {
091    return id;
092  }
093
094  public EnumWrapper<ShieldInformationBarrierTypeField> getType() {
095    return type;
096  }
097
098  public EnterpriseBase getEnterprise() {
099    return enterprise;
100  }
101
102  public EnumWrapper<ShieldInformationBarrierStatusField> getStatus() {
103    return status;
104  }
105
106  public OffsetDateTime getCreatedAt() {
107    return createdAt;
108  }
109
110  public UserBase getCreatedBy() {
111    return createdBy;
112  }
113
114  public OffsetDateTime getUpdatedAt() {
115    return updatedAt;
116  }
117
118  public UserBase getUpdatedBy() {
119    return updatedBy;
120  }
121
122  public OffsetDateTime getEnabledAt() {
123    return enabledAt;
124  }
125
126  public UserBase getEnabledBy() {
127    return enabledBy;
128  }
129
130  @Override
131  public boolean equals(Object o) {
132    if (this == o) {
133      return true;
134    }
135    if (o == null || getClass() != o.getClass()) {
136      return false;
137    }
138    ShieldInformationBarrier casted = (ShieldInformationBarrier) o;
139    return Objects.equals(id, casted.id)
140        && Objects.equals(type, casted.type)
141        && Objects.equals(enterprise, casted.enterprise)
142        && Objects.equals(status, casted.status)
143        && Objects.equals(createdAt, casted.createdAt)
144        && Objects.equals(createdBy, casted.createdBy)
145        && Objects.equals(updatedAt, casted.updatedAt)
146        && Objects.equals(updatedBy, casted.updatedBy)
147        && Objects.equals(enabledAt, casted.enabledAt)
148        && Objects.equals(enabledBy, casted.enabledBy);
149  }
150
151  @Override
152  public int hashCode() {
153    return Objects.hash(
154        id,
155        type,
156        enterprise,
157        status,
158        createdAt,
159        createdBy,
160        updatedAt,
161        updatedBy,
162        enabledAt,
163        enabledBy);
164  }
165
166  @Override
167  public String toString() {
168    return "ShieldInformationBarrier{"
169        + "id='"
170        + id
171        + '\''
172        + ", "
173        + "type='"
174        + type
175        + '\''
176        + ", "
177        + "enterprise='"
178        + enterprise
179        + '\''
180        + ", "
181        + "status='"
182        + status
183        + '\''
184        + ", "
185        + "createdAt='"
186        + createdAt
187        + '\''
188        + ", "
189        + "createdBy='"
190        + createdBy
191        + '\''
192        + ", "
193        + "updatedAt='"
194        + updatedAt
195        + '\''
196        + ", "
197        + "updatedBy='"
198        + updatedBy
199        + '\''
200        + ", "
201        + "enabledAt='"
202        + enabledAt
203        + '\''
204        + ", "
205        + "enabledBy='"
206        + enabledBy
207        + '\''
208        + "}";
209  }
210
211  public static class Builder extends NullableFieldTracker {
212
213    protected String id;
214
215    protected EnumWrapper<ShieldInformationBarrierTypeField> type;
216
217    protected EnterpriseBase enterprise;
218
219    protected EnumWrapper<ShieldInformationBarrierStatusField> status;
220
221    protected OffsetDateTime createdAt;
222
223    protected UserBase createdBy;
224
225    protected OffsetDateTime updatedAt;
226
227    protected UserBase updatedBy;
228
229    protected OffsetDateTime enabledAt;
230
231    protected UserBase enabledBy;
232
233    public Builder id(String id) {
234      this.id = id;
235      return this;
236    }
237
238    public Builder type(ShieldInformationBarrierTypeField type) {
239      this.type = new EnumWrapper<ShieldInformationBarrierTypeField>(type);
240      return this;
241    }
242
243    public Builder type(EnumWrapper<ShieldInformationBarrierTypeField> type) {
244      this.type = type;
245      return this;
246    }
247
248    public Builder enterprise(EnterpriseBase enterprise) {
249      this.enterprise = enterprise;
250      return this;
251    }
252
253    public Builder status(ShieldInformationBarrierStatusField status) {
254      this.status = new EnumWrapper<ShieldInformationBarrierStatusField>(status);
255      return this;
256    }
257
258    public Builder status(EnumWrapper<ShieldInformationBarrierStatusField> status) {
259      this.status = status;
260      return this;
261    }
262
263    public Builder createdAt(OffsetDateTime createdAt) {
264      this.createdAt = createdAt;
265      return this;
266    }
267
268    public Builder createdBy(UserBase createdBy) {
269      this.createdBy = createdBy;
270      return this;
271    }
272
273    public Builder updatedAt(OffsetDateTime updatedAt) {
274      this.updatedAt = updatedAt;
275      return this;
276    }
277
278    public Builder updatedBy(UserBase updatedBy) {
279      this.updatedBy = updatedBy;
280      return this;
281    }
282
283    public Builder enabledAt(OffsetDateTime enabledAt) {
284      this.enabledAt = enabledAt;
285      return this;
286    }
287
288    public Builder enabledBy(UserBase enabledBy) {
289      this.enabledBy = enabledBy;
290      return this;
291    }
292
293    public ShieldInformationBarrier build() {
294      return new ShieldInformationBarrier(this);
295    }
296  }
297}