001package com.box.sdkgen.schemas.trashweblinkrestored;
002
003import com.box.sdkgen.internal.Nullable;
004import com.box.sdkgen.internal.NullableFieldTracker;
005import com.box.sdkgen.internal.SerializableObject;
006import com.box.sdkgen.internal.utils.DateTimeUtils;
007import com.box.sdkgen.schemas.foldermini.FolderMini;
008import com.box.sdkgen.schemas.usermini.UserMini;
009import com.box.sdkgen.serialization.json.EnumWrapper;
010import com.fasterxml.jackson.annotation.JsonFilter;
011import com.fasterxml.jackson.annotation.JsonProperty;
012import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
013import com.fasterxml.jackson.databind.annotation.JsonSerialize;
014import java.time.OffsetDateTime;
015import java.util.Objects;
016
017/** Represents a web link restored from the trash. */
018@JsonFilter("nullablePropertyFilter")
019public class TrashWebLinkRestored extends SerializableObject {
020
021  /** The value will always be `web_link`. */
022  @JsonDeserialize(
023      using = TrashWebLinkRestoredTypeField.TrashWebLinkRestoredTypeFieldDeserializer.class)
024  @JsonSerialize(
025      using = TrashWebLinkRestoredTypeField.TrashWebLinkRestoredTypeFieldSerializer.class)
026  protected EnumWrapper<TrashWebLinkRestoredTypeField> type;
027
028  /** The unique identifier for this web link. */
029  protected String id;
030
031  @JsonProperty("sequence_id")
032  protected final String sequenceId;
033
034  /** The entity tag of this web link. Used with `If-Match` headers. */
035  protected String etag;
036
037  /** The name of the web link. */
038  protected String name;
039
040  /** The URL this web link points to. */
041  protected String url;
042
043  protected FolderMini parent;
044
045  /** The description accompanying the web link. This is visible within the Box web application. */
046  protected String description;
047
048  @JsonProperty("path_collection")
049  protected final TrashWebLinkRestoredPathCollectionField pathCollection;
050
051  /** When this file was created on Box’s servers. */
052  @JsonProperty("created_at")
053  @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class)
054  @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class)
055  protected OffsetDateTime createdAt;
056
057  /** When this file was last updated on the Box servers. */
058  @JsonProperty("modified_at")
059  @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class)
060  @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class)
061  protected OffsetDateTime modifiedAt;
062
063  /** The time at which this bookmark was put in the trash - becomes `null` after restore. */
064  @JsonProperty("trashed_at")
065  @Nullable
066  protected String trashedAt;
067
068  /** The time at which this bookmark will be permanently deleted - becomes `null` after restore. */
069  @JsonProperty("purged_at")
070  @Nullable
071  protected String purgedAt;
072
073  @JsonProperty("created_by")
074  protected UserMini createdBy;
075
076  @JsonProperty("modified_by")
077  protected UserMini modifiedBy;
078
079  @JsonProperty("owned_by")
080  protected UserMini ownedBy;
081
082  /**
083   * The shared link for this bookmark. This will be `null` if a bookmark had been trashed, even
084   * though the original shared link does become active again.
085   */
086  @JsonProperty("shared_link")
087  @Nullable
088  protected String sharedLink;
089
090  /**
091   * Whether this item is deleted or not. Values include `active`, `trashed` if the file has been
092   * moved to the trash, and `deleted` if the file has been permanently deleted.
093   */
094  @JsonDeserialize(
095      using =
096          TrashWebLinkRestoredItemStatusField.TrashWebLinkRestoredItemStatusFieldDeserializer.class)
097  @JsonSerialize(
098      using =
099          TrashWebLinkRestoredItemStatusField.TrashWebLinkRestoredItemStatusFieldSerializer.class)
100  @JsonProperty("item_status")
101  protected EnumWrapper<TrashWebLinkRestoredItemStatusField> itemStatus;
102
103  public TrashWebLinkRestored(
104      @JsonProperty("sequence_id") String sequenceId,
105      @JsonProperty("path_collection") TrashWebLinkRestoredPathCollectionField pathCollection) {
106    super();
107    this.sequenceId = sequenceId;
108    this.pathCollection = pathCollection;
109  }
110
111  protected TrashWebLinkRestored(Builder builder) {
112    super();
113    this.type = builder.type;
114    this.id = builder.id;
115    this.sequenceId = builder.sequenceId;
116    this.etag = builder.etag;
117    this.name = builder.name;
118    this.url = builder.url;
119    this.parent = builder.parent;
120    this.description = builder.description;
121    this.pathCollection = builder.pathCollection;
122    this.createdAt = builder.createdAt;
123    this.modifiedAt = builder.modifiedAt;
124    this.trashedAt = builder.trashedAt;
125    this.purgedAt = builder.purgedAt;
126    this.createdBy = builder.createdBy;
127    this.modifiedBy = builder.modifiedBy;
128    this.ownedBy = builder.ownedBy;
129    this.sharedLink = builder.sharedLink;
130    this.itemStatus = builder.itemStatus;
131    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
132  }
133
134  public EnumWrapper<TrashWebLinkRestoredTypeField> getType() {
135    return type;
136  }
137
138  public String getId() {
139    return id;
140  }
141
142  public String getSequenceId() {
143    return sequenceId;
144  }
145
146  public String getEtag() {
147    return etag;
148  }
149
150  public String getName() {
151    return name;
152  }
153
154  public String getUrl() {
155    return url;
156  }
157
158  public FolderMini getParent() {
159    return parent;
160  }
161
162  public String getDescription() {
163    return description;
164  }
165
166  public TrashWebLinkRestoredPathCollectionField getPathCollection() {
167    return pathCollection;
168  }
169
170  public OffsetDateTime getCreatedAt() {
171    return createdAt;
172  }
173
174  public OffsetDateTime getModifiedAt() {
175    return modifiedAt;
176  }
177
178  public String getTrashedAt() {
179    return trashedAt;
180  }
181
182  public String getPurgedAt() {
183    return purgedAt;
184  }
185
186  public UserMini getCreatedBy() {
187    return createdBy;
188  }
189
190  public UserMini getModifiedBy() {
191    return modifiedBy;
192  }
193
194  public UserMini getOwnedBy() {
195    return ownedBy;
196  }
197
198  public String getSharedLink() {
199    return sharedLink;
200  }
201
202  public EnumWrapper<TrashWebLinkRestoredItemStatusField> getItemStatus() {
203    return itemStatus;
204  }
205
206  @Override
207  public boolean equals(Object o) {
208    if (this == o) {
209      return true;
210    }
211    if (o == null || getClass() != o.getClass()) {
212      return false;
213    }
214    TrashWebLinkRestored casted = (TrashWebLinkRestored) o;
215    return Objects.equals(type, casted.type)
216        && Objects.equals(id, casted.id)
217        && Objects.equals(sequenceId, casted.sequenceId)
218        && Objects.equals(etag, casted.etag)
219        && Objects.equals(name, casted.name)
220        && Objects.equals(url, casted.url)
221        && Objects.equals(parent, casted.parent)
222        && Objects.equals(description, casted.description)
223        && Objects.equals(pathCollection, casted.pathCollection)
224        && Objects.equals(createdAt, casted.createdAt)
225        && Objects.equals(modifiedAt, casted.modifiedAt)
226        && Objects.equals(trashedAt, casted.trashedAt)
227        && Objects.equals(purgedAt, casted.purgedAt)
228        && Objects.equals(createdBy, casted.createdBy)
229        && Objects.equals(modifiedBy, casted.modifiedBy)
230        && Objects.equals(ownedBy, casted.ownedBy)
231        && Objects.equals(sharedLink, casted.sharedLink)
232        && Objects.equals(itemStatus, casted.itemStatus);
233  }
234
235  @Override
236  public int hashCode() {
237    return Objects.hash(
238        type,
239        id,
240        sequenceId,
241        etag,
242        name,
243        url,
244        parent,
245        description,
246        pathCollection,
247        createdAt,
248        modifiedAt,
249        trashedAt,
250        purgedAt,
251        createdBy,
252        modifiedBy,
253        ownedBy,
254        sharedLink,
255        itemStatus);
256  }
257
258  @Override
259  public String toString() {
260    return "TrashWebLinkRestored{"
261        + "type='"
262        + type
263        + '\''
264        + ", "
265        + "id='"
266        + id
267        + '\''
268        + ", "
269        + "sequenceId='"
270        + sequenceId
271        + '\''
272        + ", "
273        + "etag='"
274        + etag
275        + '\''
276        + ", "
277        + "name='"
278        + name
279        + '\''
280        + ", "
281        + "url='"
282        + url
283        + '\''
284        + ", "
285        + "parent='"
286        + parent
287        + '\''
288        + ", "
289        + "description='"
290        + description
291        + '\''
292        + ", "
293        + "pathCollection='"
294        + pathCollection
295        + '\''
296        + ", "
297        + "createdAt='"
298        + createdAt
299        + '\''
300        + ", "
301        + "modifiedAt='"
302        + modifiedAt
303        + '\''
304        + ", "
305        + "trashedAt='"
306        + trashedAt
307        + '\''
308        + ", "
309        + "purgedAt='"
310        + purgedAt
311        + '\''
312        + ", "
313        + "createdBy='"
314        + createdBy
315        + '\''
316        + ", "
317        + "modifiedBy='"
318        + modifiedBy
319        + '\''
320        + ", "
321        + "ownedBy='"
322        + ownedBy
323        + '\''
324        + ", "
325        + "sharedLink='"
326        + sharedLink
327        + '\''
328        + ", "
329        + "itemStatus='"
330        + itemStatus
331        + '\''
332        + "}";
333  }
334
335  public static class Builder extends NullableFieldTracker {
336
337    protected EnumWrapper<TrashWebLinkRestoredTypeField> type;
338
339    protected String id;
340
341    protected final String sequenceId;
342
343    protected String etag;
344
345    protected String name;
346
347    protected String url;
348
349    protected FolderMini parent;
350
351    protected String description;
352
353    protected final TrashWebLinkRestoredPathCollectionField pathCollection;
354
355    protected OffsetDateTime createdAt;
356
357    protected OffsetDateTime modifiedAt;
358
359    protected String trashedAt;
360
361    protected String purgedAt;
362
363    protected UserMini createdBy;
364
365    protected UserMini modifiedBy;
366
367    protected UserMini ownedBy;
368
369    protected String sharedLink;
370
371    protected EnumWrapper<TrashWebLinkRestoredItemStatusField> itemStatus;
372
373    public Builder(String sequenceId, TrashWebLinkRestoredPathCollectionField pathCollection) {
374      super();
375      this.sequenceId = sequenceId;
376      this.pathCollection = pathCollection;
377    }
378
379    public Builder type(TrashWebLinkRestoredTypeField type) {
380      this.type = new EnumWrapper<TrashWebLinkRestoredTypeField>(type);
381      return this;
382    }
383
384    public Builder type(EnumWrapper<TrashWebLinkRestoredTypeField> type) {
385      this.type = type;
386      return this;
387    }
388
389    public Builder id(String id) {
390      this.id = id;
391      return this;
392    }
393
394    public Builder etag(String etag) {
395      this.etag = etag;
396      return this;
397    }
398
399    public Builder name(String name) {
400      this.name = name;
401      return this;
402    }
403
404    public Builder url(String url) {
405      this.url = url;
406      return this;
407    }
408
409    public Builder parent(FolderMini parent) {
410      this.parent = parent;
411      return this;
412    }
413
414    public Builder description(String description) {
415      this.description = description;
416      return this;
417    }
418
419    public Builder createdAt(OffsetDateTime createdAt) {
420      this.createdAt = createdAt;
421      return this;
422    }
423
424    public Builder modifiedAt(OffsetDateTime modifiedAt) {
425      this.modifiedAt = modifiedAt;
426      return this;
427    }
428
429    public Builder trashedAt(String trashedAt) {
430      this.trashedAt = trashedAt;
431      this.markNullableFieldAsSet("trashed_at");
432      return this;
433    }
434
435    public Builder purgedAt(String purgedAt) {
436      this.purgedAt = purgedAt;
437      this.markNullableFieldAsSet("purged_at");
438      return this;
439    }
440
441    public Builder createdBy(UserMini createdBy) {
442      this.createdBy = createdBy;
443      return this;
444    }
445
446    public Builder modifiedBy(UserMini modifiedBy) {
447      this.modifiedBy = modifiedBy;
448      return this;
449    }
450
451    public Builder ownedBy(UserMini ownedBy) {
452      this.ownedBy = ownedBy;
453      return this;
454    }
455
456    public Builder sharedLink(String sharedLink) {
457      this.sharedLink = sharedLink;
458      this.markNullableFieldAsSet("shared_link");
459      return this;
460    }
461
462    public Builder itemStatus(TrashWebLinkRestoredItemStatusField itemStatus) {
463      this.itemStatus = new EnumWrapper<TrashWebLinkRestoredItemStatusField>(itemStatus);
464      return this;
465    }
466
467    public Builder itemStatus(EnumWrapper<TrashWebLinkRestoredItemStatusField> itemStatus) {
468      this.itemStatus = itemStatus;
469      return this;
470    }
471
472    public TrashWebLinkRestored build() {
473      return new TrashWebLinkRestored(this);
474    }
475  }
476}