001package com.box.sdkgen.schemas.trashfolderrestored; 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 folder restored from the trash. */ 018@JsonFilter("nullablePropertyFilter") 019public class TrashFolderRestored extends SerializableObject { 020 021 /** 022 * The unique identifier that represent a folder. 023 * 024 * <p>The ID for any folder can be determined by visiting a folder in the web application and 025 * copying the ID from the URL. For example, for the URL `https://*.app.box.com/folders/123` the 026 * `folder_id` is `123`. 027 */ 028 protected String id; 029 030 /** 031 * The HTTP `etag` of this folder. This can be used within some API endpoints in the `If-Match` 032 * and `If-None-Match` headers to only perform changes on the folder if (no) changes have 033 * happened. 034 */ 035 @Nullable protected String etag; 036 037 /** The value will always be `folder`. */ 038 @JsonDeserialize( 039 using = TrashFolderRestoredTypeField.TrashFolderRestoredTypeFieldDeserializer.class) 040 @JsonSerialize(using = TrashFolderRestoredTypeField.TrashFolderRestoredTypeFieldSerializer.class) 041 protected EnumWrapper<TrashFolderRestoredTypeField> type; 042 043 @JsonProperty("sequence_id") 044 protected String sequenceId; 045 046 /** The name of the folder. */ 047 protected String name; 048 049 /** 050 * The date and time when the folder was created. This value may be `null` for some folders such 051 * as the root folder or the trash folder. 052 */ 053 @JsonProperty("created_at") 054 @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class) 055 @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class) 056 @Nullable 057 protected OffsetDateTime createdAt; 058 059 /** 060 * The date and time when the folder was last updated. This value may be `null` for some folders 061 * such as the root folder or the trash folder. 062 */ 063 @JsonProperty("modified_at") 064 @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class) 065 @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class) 066 @Nullable 067 protected OffsetDateTime modifiedAt; 068 069 protected String description; 070 071 /** 072 * The folder size in bytes. 073 * 074 * <p>Be careful parsing this integer as its value can get very large. 075 */ 076 protected Long size; 077 078 @JsonProperty("path_collection") 079 protected TrashFolderRestoredPathCollectionField pathCollection; 080 081 @JsonProperty("created_by") 082 protected UserMini createdBy; 083 084 @JsonProperty("modified_by") 085 protected UserMini modifiedBy; 086 087 /** The time at which this folder was put in the trash - becomes `null` after restore. */ 088 @JsonProperty("trashed_at") 089 @Nullable 090 protected String trashedAt; 091 092 /** 093 * The time at which this folder is expected to be purged from the trash - becomes `null` after 094 * restore. 095 */ 096 @JsonProperty("purged_at") 097 @Nullable 098 protected String purgedAt; 099 100 /** The date and time at which this folder was originally created. */ 101 @JsonProperty("content_created_at") 102 @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class) 103 @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class) 104 @Nullable 105 protected OffsetDateTime contentCreatedAt; 106 107 /** The date and time at which this folder was last updated. */ 108 @JsonProperty("content_modified_at") 109 @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class) 110 @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class) 111 @Nullable 112 protected OffsetDateTime contentModifiedAt; 113 114 @JsonProperty("owned_by") 115 protected UserMini ownedBy; 116 117 /** 118 * The shared link for this file. This will be `null` if a folder had been trashed, even though 119 * the original shared link does become active again. 120 */ 121 @JsonProperty("shared_link") 122 @Nullable 123 protected String sharedLink; 124 125 /** 126 * The folder upload email for this folder. This will be `null` if a folder has been trashed, even 127 * though the original upload email does become active again. 128 */ 129 @JsonProperty("folder_upload_email") 130 @Nullable 131 protected String folderUploadEmail; 132 133 protected FolderMini parent; 134 135 /** 136 * Defines if this item has been deleted or not. 137 * 138 * <p>* `active` when the item has is not in the trash, * `trashed` when the item has been moved 139 * to the trash but not deleted, * `deleted` when the item has been permanently deleted. 140 */ 141 @JsonDeserialize( 142 using = 143 TrashFolderRestoredItemStatusField.TrashFolderRestoredItemStatusFieldDeserializer.class) 144 @JsonSerialize( 145 using = TrashFolderRestoredItemStatusField.TrashFolderRestoredItemStatusFieldSerializer.class) 146 @JsonProperty("item_status") 147 protected EnumWrapper<TrashFolderRestoredItemStatusField> itemStatus; 148 149 public TrashFolderRestored() { 150 super(); 151 } 152 153 protected TrashFolderRestored(Builder builder) { 154 super(); 155 this.id = builder.id; 156 this.etag = builder.etag; 157 this.type = builder.type; 158 this.sequenceId = builder.sequenceId; 159 this.name = builder.name; 160 this.createdAt = builder.createdAt; 161 this.modifiedAt = builder.modifiedAt; 162 this.description = builder.description; 163 this.size = builder.size; 164 this.pathCollection = builder.pathCollection; 165 this.createdBy = builder.createdBy; 166 this.modifiedBy = builder.modifiedBy; 167 this.trashedAt = builder.trashedAt; 168 this.purgedAt = builder.purgedAt; 169 this.contentCreatedAt = builder.contentCreatedAt; 170 this.contentModifiedAt = builder.contentModifiedAt; 171 this.ownedBy = builder.ownedBy; 172 this.sharedLink = builder.sharedLink; 173 this.folderUploadEmail = builder.folderUploadEmail; 174 this.parent = builder.parent; 175 this.itemStatus = builder.itemStatus; 176 markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); 177 } 178 179 public String getId() { 180 return id; 181 } 182 183 public String getEtag() { 184 return etag; 185 } 186 187 public EnumWrapper<TrashFolderRestoredTypeField> getType() { 188 return type; 189 } 190 191 public String getSequenceId() { 192 return sequenceId; 193 } 194 195 public String getName() { 196 return name; 197 } 198 199 public OffsetDateTime getCreatedAt() { 200 return createdAt; 201 } 202 203 public OffsetDateTime getModifiedAt() { 204 return modifiedAt; 205 } 206 207 public String getDescription() { 208 return description; 209 } 210 211 public Long getSize() { 212 return size; 213 } 214 215 public TrashFolderRestoredPathCollectionField getPathCollection() { 216 return pathCollection; 217 } 218 219 public UserMini getCreatedBy() { 220 return createdBy; 221 } 222 223 public UserMini getModifiedBy() { 224 return modifiedBy; 225 } 226 227 public String getTrashedAt() { 228 return trashedAt; 229 } 230 231 public String getPurgedAt() { 232 return purgedAt; 233 } 234 235 public OffsetDateTime getContentCreatedAt() { 236 return contentCreatedAt; 237 } 238 239 public OffsetDateTime getContentModifiedAt() { 240 return contentModifiedAt; 241 } 242 243 public UserMini getOwnedBy() { 244 return ownedBy; 245 } 246 247 public String getSharedLink() { 248 return sharedLink; 249 } 250 251 public String getFolderUploadEmail() { 252 return folderUploadEmail; 253 } 254 255 public FolderMini getParent() { 256 return parent; 257 } 258 259 public EnumWrapper<TrashFolderRestoredItemStatusField> getItemStatus() { 260 return itemStatus; 261 } 262 263 @Override 264 public boolean equals(Object o) { 265 if (this == o) { 266 return true; 267 } 268 if (o == null || getClass() != o.getClass()) { 269 return false; 270 } 271 TrashFolderRestored casted = (TrashFolderRestored) o; 272 return Objects.equals(id, casted.id) 273 && Objects.equals(etag, casted.etag) 274 && Objects.equals(type, casted.type) 275 && Objects.equals(sequenceId, casted.sequenceId) 276 && Objects.equals(name, casted.name) 277 && Objects.equals(createdAt, casted.createdAt) 278 && Objects.equals(modifiedAt, casted.modifiedAt) 279 && Objects.equals(description, casted.description) 280 && Objects.equals(size, casted.size) 281 && Objects.equals(pathCollection, casted.pathCollection) 282 && Objects.equals(createdBy, casted.createdBy) 283 && Objects.equals(modifiedBy, casted.modifiedBy) 284 && Objects.equals(trashedAt, casted.trashedAt) 285 && Objects.equals(purgedAt, casted.purgedAt) 286 && Objects.equals(contentCreatedAt, casted.contentCreatedAt) 287 && Objects.equals(contentModifiedAt, casted.contentModifiedAt) 288 && Objects.equals(ownedBy, casted.ownedBy) 289 && Objects.equals(sharedLink, casted.sharedLink) 290 && Objects.equals(folderUploadEmail, casted.folderUploadEmail) 291 && Objects.equals(parent, casted.parent) 292 && Objects.equals(itemStatus, casted.itemStatus); 293 } 294 295 @Override 296 public int hashCode() { 297 return Objects.hash( 298 id, 299 etag, 300 type, 301 sequenceId, 302 name, 303 createdAt, 304 modifiedAt, 305 description, 306 size, 307 pathCollection, 308 createdBy, 309 modifiedBy, 310 trashedAt, 311 purgedAt, 312 contentCreatedAt, 313 contentModifiedAt, 314 ownedBy, 315 sharedLink, 316 folderUploadEmail, 317 parent, 318 itemStatus); 319 } 320 321 @Override 322 public String toString() { 323 return "TrashFolderRestored{" 324 + "id='" 325 + id 326 + '\'' 327 + ", " 328 + "etag='" 329 + etag 330 + '\'' 331 + ", " 332 + "type='" 333 + type 334 + '\'' 335 + ", " 336 + "sequenceId='" 337 + sequenceId 338 + '\'' 339 + ", " 340 + "name='" 341 + name 342 + '\'' 343 + ", " 344 + "createdAt='" 345 + createdAt 346 + '\'' 347 + ", " 348 + "modifiedAt='" 349 + modifiedAt 350 + '\'' 351 + ", " 352 + "description='" 353 + description 354 + '\'' 355 + ", " 356 + "size='" 357 + size 358 + '\'' 359 + ", " 360 + "pathCollection='" 361 + pathCollection 362 + '\'' 363 + ", " 364 + "createdBy='" 365 + createdBy 366 + '\'' 367 + ", " 368 + "modifiedBy='" 369 + modifiedBy 370 + '\'' 371 + ", " 372 + "trashedAt='" 373 + trashedAt 374 + '\'' 375 + ", " 376 + "purgedAt='" 377 + purgedAt 378 + '\'' 379 + ", " 380 + "contentCreatedAt='" 381 + contentCreatedAt 382 + '\'' 383 + ", " 384 + "contentModifiedAt='" 385 + contentModifiedAt 386 + '\'' 387 + ", " 388 + "ownedBy='" 389 + ownedBy 390 + '\'' 391 + ", " 392 + "sharedLink='" 393 + sharedLink 394 + '\'' 395 + ", " 396 + "folderUploadEmail='" 397 + folderUploadEmail 398 + '\'' 399 + ", " 400 + "parent='" 401 + parent 402 + '\'' 403 + ", " 404 + "itemStatus='" 405 + itemStatus 406 + '\'' 407 + "}"; 408 } 409 410 public static class Builder extends NullableFieldTracker { 411 412 protected String id; 413 414 protected String etag; 415 416 protected EnumWrapper<TrashFolderRestoredTypeField> type; 417 418 protected String sequenceId; 419 420 protected String name; 421 422 protected OffsetDateTime createdAt; 423 424 protected OffsetDateTime modifiedAt; 425 426 protected String description; 427 428 protected Long size; 429 430 protected TrashFolderRestoredPathCollectionField pathCollection; 431 432 protected UserMini createdBy; 433 434 protected UserMini modifiedBy; 435 436 protected String trashedAt; 437 438 protected String purgedAt; 439 440 protected OffsetDateTime contentCreatedAt; 441 442 protected OffsetDateTime contentModifiedAt; 443 444 protected UserMini ownedBy; 445 446 protected String sharedLink; 447 448 protected String folderUploadEmail; 449 450 protected FolderMini parent; 451 452 protected EnumWrapper<TrashFolderRestoredItemStatusField> itemStatus; 453 454 public Builder id(String id) { 455 this.id = id; 456 return this; 457 } 458 459 public Builder etag(String etag) { 460 this.etag = etag; 461 this.markNullableFieldAsSet("etag"); 462 return this; 463 } 464 465 public Builder type(TrashFolderRestoredTypeField type) { 466 this.type = new EnumWrapper<TrashFolderRestoredTypeField>(type); 467 return this; 468 } 469 470 public Builder type(EnumWrapper<TrashFolderRestoredTypeField> type) { 471 this.type = type; 472 return this; 473 } 474 475 public Builder sequenceId(String sequenceId) { 476 this.sequenceId = sequenceId; 477 return this; 478 } 479 480 public Builder name(String name) { 481 this.name = name; 482 return this; 483 } 484 485 public Builder createdAt(OffsetDateTime createdAt) { 486 this.createdAt = createdAt; 487 this.markNullableFieldAsSet("created_at"); 488 return this; 489 } 490 491 public Builder modifiedAt(OffsetDateTime modifiedAt) { 492 this.modifiedAt = modifiedAt; 493 this.markNullableFieldAsSet("modified_at"); 494 return this; 495 } 496 497 public Builder description(String description) { 498 this.description = description; 499 return this; 500 } 501 502 public Builder size(Long size) { 503 this.size = size; 504 return this; 505 } 506 507 public Builder pathCollection(TrashFolderRestoredPathCollectionField pathCollection) { 508 this.pathCollection = pathCollection; 509 return this; 510 } 511 512 public Builder createdBy(UserMini createdBy) { 513 this.createdBy = createdBy; 514 return this; 515 } 516 517 public Builder modifiedBy(UserMini modifiedBy) { 518 this.modifiedBy = modifiedBy; 519 return this; 520 } 521 522 public Builder trashedAt(String trashedAt) { 523 this.trashedAt = trashedAt; 524 this.markNullableFieldAsSet("trashed_at"); 525 return this; 526 } 527 528 public Builder purgedAt(String purgedAt) { 529 this.purgedAt = purgedAt; 530 this.markNullableFieldAsSet("purged_at"); 531 return this; 532 } 533 534 public Builder contentCreatedAt(OffsetDateTime contentCreatedAt) { 535 this.contentCreatedAt = contentCreatedAt; 536 this.markNullableFieldAsSet("content_created_at"); 537 return this; 538 } 539 540 public Builder contentModifiedAt(OffsetDateTime contentModifiedAt) { 541 this.contentModifiedAt = contentModifiedAt; 542 this.markNullableFieldAsSet("content_modified_at"); 543 return this; 544 } 545 546 public Builder ownedBy(UserMini ownedBy) { 547 this.ownedBy = ownedBy; 548 return this; 549 } 550 551 public Builder sharedLink(String sharedLink) { 552 this.sharedLink = sharedLink; 553 this.markNullableFieldAsSet("shared_link"); 554 return this; 555 } 556 557 public Builder folderUploadEmail(String folderUploadEmail) { 558 this.folderUploadEmail = folderUploadEmail; 559 this.markNullableFieldAsSet("folder_upload_email"); 560 return this; 561 } 562 563 public Builder parent(FolderMini parent) { 564 this.parent = parent; 565 return this; 566 } 567 568 public Builder itemStatus(TrashFolderRestoredItemStatusField itemStatus) { 569 this.itemStatus = new EnumWrapper<TrashFolderRestoredItemStatusField>(itemStatus); 570 return this; 571 } 572 573 public Builder itemStatus(EnumWrapper<TrashFolderRestoredItemStatusField> itemStatus) { 574 this.itemStatus = itemStatus; 575 return this; 576 } 577 578 public TrashFolderRestored build() { 579 return new TrashFolderRestored(this); 580 } 581 } 582}