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