001package com.box.sdkgen.schemas.filefull; 002 003import com.box.sdkgen.internal.Nullable; 004import com.box.sdkgen.internal.utils.DateTimeUtils; 005import com.box.sdkgen.schemas.collection.Collection; 006import com.box.sdkgen.schemas.file.File; 007import com.box.sdkgen.schemas.file.FileItemStatusField; 008import com.box.sdkgen.schemas.file.FilePathCollectionField; 009import com.box.sdkgen.schemas.file.FileSharedLinkField; 010import com.box.sdkgen.schemas.filebase.FileBaseTypeField; 011import com.box.sdkgen.schemas.fileversionmini.FileVersionMini; 012import com.box.sdkgen.schemas.foldermini.FolderMini; 013import com.box.sdkgen.schemas.usermini.UserMini; 014import com.box.sdkgen.serialization.json.EnumWrapper; 015import com.box.sdkgen.serialization.json.Valuable; 016import com.fasterxml.jackson.annotation.JsonFilter; 017import com.fasterxml.jackson.annotation.JsonProperty; 018import com.fasterxml.jackson.core.JsonGenerator; 019import com.fasterxml.jackson.core.JsonParser; 020import com.fasterxml.jackson.databind.DeserializationContext; 021import com.fasterxml.jackson.databind.JsonDeserializer; 022import com.fasterxml.jackson.databind.JsonNode; 023import com.fasterxml.jackson.databind.JsonSerializer; 024import com.fasterxml.jackson.databind.SerializerProvider; 025import com.fasterxml.jackson.databind.annotation.JsonDeserialize; 026import com.fasterxml.jackson.databind.annotation.JsonSerialize; 027import java.io.IOException; 028import java.time.OffsetDateTime; 029import java.util.ArrayList; 030import java.util.List; 031import java.util.Objects; 032 033/** A full representation of a file, as can be returned from any file API endpoints by default. */ 034@JsonFilter("nullablePropertyFilter") 035public class FileFull extends File { 036 037 /** The version number of this file. */ 038 @JsonProperty("version_number") 039 protected String versionNumber; 040 041 /** The number of comments on this file. */ 042 @JsonProperty("comment_count") 043 protected Long commentCount; 044 045 protected FileFullPermissionsField permissions; 046 047 protected List<String> tags; 048 049 @Nullable protected FileFullLockField lock; 050 051 /** 052 * Indicates the (optional) file extension for this file. By default, this is set to an empty 053 * string. 054 */ 055 protected String extension; 056 057 /** 058 * Indicates if the file is a package. Packages are commonly used by Mac Applications and can 059 * include iWork files. 060 */ 061 @JsonProperty("is_package") 062 protected Boolean isPackage; 063 064 @JsonProperty("expiring_embed_link") 065 protected FileFullExpiringEmbedLinkField expiringEmbedLink; 066 067 @JsonProperty("watermark_info") 068 protected FileFullWatermarkInfoField watermarkInfo; 069 070 /** 071 * Specifies if the file can be accessed via the direct shared link or a shared link to a parent 072 * folder. 073 */ 074 @JsonProperty("is_accessible_via_shared_link") 075 protected Boolean isAccessibleViaSharedLink; 076 077 /** A list of the types of roles that user can be invited at when sharing this file. */ 078 @JsonDeserialize(using = AllowedInviteeRolesDeserializer.class) 079 @JsonSerialize(using = AllowedInviteeRolesSerializer.class) 080 @JsonProperty("allowed_invitee_roles") 081 protected List<EnumWrapper<FileFullAllowedInviteeRolesField>> allowedInviteeRoles; 082 083 /** Specifies if this file is owned by a user outside of the authenticated enterprise. */ 084 @JsonProperty("is_externally_owned") 085 protected Boolean isExternallyOwned; 086 087 /** Specifies if this file has any other collaborators. */ 088 @JsonProperty("has_collaborations") 089 protected Boolean hasCollaborations; 090 091 protected FileFullMetadataField metadata; 092 093 /** When the file will automatically be deleted. */ 094 @JsonProperty("expires_at") 095 @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class) 096 @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class) 097 @Nullable 098 protected OffsetDateTime expiresAt; 099 100 protected FileFullRepresentationsField representations; 101 102 protected FileFullClassificationField classification; 103 104 @JsonProperty("uploader_display_name") 105 protected String uploaderDisplayName; 106 107 /** The retention expiration timestamp for the given file. */ 108 @JsonProperty("disposition_at") 109 @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class) 110 @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class) 111 @Nullable 112 protected OffsetDateTime dispositionAt; 113 114 /** A list of the types of roles that user can be invited at when sharing this file. */ 115 @JsonDeserialize(using = SharedLinkPermissionOptionsDeserializer.class) 116 @JsonSerialize(using = SharedLinkPermissionOptionsSerializer.class) 117 @JsonProperty("shared_link_permission_options") 118 @Nullable 119 protected List<EnumWrapper<FileFullSharedLinkPermissionOptionsField>> sharedLinkPermissionOptions; 120 121 /** 122 * This field will return true if the file or any ancestor of the file is associated with at least 123 * one app item. Note that this will return true even if the context user does not have access to 124 * the app item(s) associated with the file. 125 */ 126 @JsonProperty("is_associated_with_app_item") 127 protected Boolean isAssociatedWithAppItem; 128 129 /** 130 * The collections that this file belongs to. 131 * 132 * <p>For more information, see the [collections 133 * guide](https://developer.box.com/guides/collections). 134 */ 135 protected List<Collection> collections; 136 137 /** 138 * Whether the file's binary content is eligible to be downloaded. 139 * 140 * <p>This is a content-level flag and does not reflect whether the current user is authorized to 141 * download the file. Use `permissions.can_download`, when available, for that. 142 */ 143 @JsonProperty("is_download_available") 144 protected Boolean isDownloadAvailable; 145 146 /** 147 * A pre-authorized, expiring URL for directly downloading the file's content. Requires 148 * authentication and is valid only for the current session. 149 * 150 * <p>This field is only returned for files, not folders or web links. 151 */ 152 @JsonProperty("download_url") 153 protected String downloadUrl; 154 155 /** 156 * A stable API URL for the file content endpoint, `/2.0/files/{id}/content`. Unlike 157 * `download_url`, authorization is evaluated when the URL is requested with a valid access token. 158 * 159 * <p>This field is only returned for files, not folders or web links. 160 */ 161 @JsonProperty("authenticated_download_url") 162 protected String authenticatedDownloadUrl; 163 164 /** 165 * The shared link access levels the authenticated user is allowed to use when creating or 166 * updating a shared link for this file. 167 * 168 * <p>The list depends on item policy and user authorization, so it may be narrower than the 169 * levels available to the owner. An empty array means no access level is available to this user. 170 */ 171 @JsonDeserialize(using = AllowedSharedLinkAccessLevelsDeserializer.class) 172 @JsonSerialize(using = AllowedSharedLinkAccessLevelsSerializer.class) 173 @JsonProperty("allowed_shared_link_access_levels") 174 protected List<EnumWrapper<FileFullAllowedSharedLinkAccessLevelsField>> 175 allowedSharedLinkAccessLevels; 176 177 public FileFull(@JsonProperty("id") String id) { 178 super(id); 179 } 180 181 protected FileFull(Builder builder) { 182 super(builder); 183 this.versionNumber = builder.versionNumber; 184 this.commentCount = builder.commentCount; 185 this.permissions = builder.permissions; 186 this.tags = builder.tags; 187 this.lock = builder.lock; 188 this.extension = builder.extension; 189 this.isPackage = builder.isPackage; 190 this.expiringEmbedLink = builder.expiringEmbedLink; 191 this.watermarkInfo = builder.watermarkInfo; 192 this.isAccessibleViaSharedLink = builder.isAccessibleViaSharedLink; 193 this.allowedInviteeRoles = builder.allowedInviteeRoles; 194 this.isExternallyOwned = builder.isExternallyOwned; 195 this.hasCollaborations = builder.hasCollaborations; 196 this.metadata = builder.metadata; 197 this.expiresAt = builder.expiresAt; 198 this.representations = builder.representations; 199 this.classification = builder.classification; 200 this.uploaderDisplayName = builder.uploaderDisplayName; 201 this.dispositionAt = builder.dispositionAt; 202 this.sharedLinkPermissionOptions = builder.sharedLinkPermissionOptions; 203 this.isAssociatedWithAppItem = builder.isAssociatedWithAppItem; 204 this.collections = builder.collections; 205 this.isDownloadAvailable = builder.isDownloadAvailable; 206 this.downloadUrl = builder.downloadUrl; 207 this.authenticatedDownloadUrl = builder.authenticatedDownloadUrl; 208 this.allowedSharedLinkAccessLevels = builder.allowedSharedLinkAccessLevels; 209 markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); 210 } 211 212 public String getVersionNumber() { 213 return versionNumber; 214 } 215 216 public Long getCommentCount() { 217 return commentCount; 218 } 219 220 public FileFullPermissionsField getPermissions() { 221 return permissions; 222 } 223 224 public List<String> getTags() { 225 return tags; 226 } 227 228 public FileFullLockField getLock() { 229 return lock; 230 } 231 232 public String getExtension() { 233 return extension; 234 } 235 236 public Boolean getIsPackage() { 237 return isPackage; 238 } 239 240 public FileFullExpiringEmbedLinkField getExpiringEmbedLink() { 241 return expiringEmbedLink; 242 } 243 244 public FileFullWatermarkInfoField getWatermarkInfo() { 245 return watermarkInfo; 246 } 247 248 public Boolean getIsAccessibleViaSharedLink() { 249 return isAccessibleViaSharedLink; 250 } 251 252 public List<EnumWrapper<FileFullAllowedInviteeRolesField>> getAllowedInviteeRoles() { 253 return allowedInviteeRoles; 254 } 255 256 public Boolean getIsExternallyOwned() { 257 return isExternallyOwned; 258 } 259 260 public Boolean getHasCollaborations() { 261 return hasCollaborations; 262 } 263 264 public FileFullMetadataField getMetadata() { 265 return metadata; 266 } 267 268 public OffsetDateTime getExpiresAt() { 269 return expiresAt; 270 } 271 272 public FileFullRepresentationsField getRepresentations() { 273 return representations; 274 } 275 276 public FileFullClassificationField getClassification() { 277 return classification; 278 } 279 280 public String getUploaderDisplayName() { 281 return uploaderDisplayName; 282 } 283 284 public OffsetDateTime getDispositionAt() { 285 return dispositionAt; 286 } 287 288 public List<EnumWrapper<FileFullSharedLinkPermissionOptionsField>> 289 getSharedLinkPermissionOptions() { 290 return sharedLinkPermissionOptions; 291 } 292 293 public Boolean getIsAssociatedWithAppItem() { 294 return isAssociatedWithAppItem; 295 } 296 297 public List<Collection> getCollections() { 298 return collections; 299 } 300 301 public Boolean getIsDownloadAvailable() { 302 return isDownloadAvailable; 303 } 304 305 public String getDownloadUrl() { 306 return downloadUrl; 307 } 308 309 public String getAuthenticatedDownloadUrl() { 310 return authenticatedDownloadUrl; 311 } 312 313 public List<EnumWrapper<FileFullAllowedSharedLinkAccessLevelsField>> 314 getAllowedSharedLinkAccessLevels() { 315 return allowedSharedLinkAccessLevels; 316 } 317 318 @Override 319 public boolean equals(Object o) { 320 if (this == o) { 321 return true; 322 } 323 if (o == null || getClass() != o.getClass()) { 324 return false; 325 } 326 FileFull casted = (FileFull) o; 327 return Objects.equals(id, casted.id) 328 && Objects.equals(etag, casted.etag) 329 && Objects.equals(type, casted.type) 330 && Objects.equals(sequenceId, casted.sequenceId) 331 && Objects.equals(name, casted.name) 332 && Objects.equals(sha1, casted.sha1) 333 && Objects.equals(fileVersion, casted.fileVersion) 334 && Objects.equals(description, casted.description) 335 && Objects.equals(size, casted.size) 336 && Objects.equals(pathCollection, casted.pathCollection) 337 && Objects.equals(createdAt, casted.createdAt) 338 && Objects.equals(modifiedAt, casted.modifiedAt) 339 && Objects.equals(trashedAt, casted.trashedAt) 340 && Objects.equals(purgedAt, casted.purgedAt) 341 && Objects.equals(contentCreatedAt, casted.contentCreatedAt) 342 && Objects.equals(contentModifiedAt, casted.contentModifiedAt) 343 && Objects.equals(createdBy, casted.createdBy) 344 && Objects.equals(modifiedBy, casted.modifiedBy) 345 && Objects.equals(ownedBy, casted.ownedBy) 346 && Objects.equals(sharedLink, casted.sharedLink) 347 && Objects.equals(parent, casted.parent) 348 && Objects.equals(itemStatus, casted.itemStatus) 349 && Objects.equals(versionNumber, casted.versionNumber) 350 && Objects.equals(commentCount, casted.commentCount) 351 && Objects.equals(permissions, casted.permissions) 352 && Objects.equals(tags, casted.tags) 353 && Objects.equals(lock, casted.lock) 354 && Objects.equals(extension, casted.extension) 355 && Objects.equals(isPackage, casted.isPackage) 356 && Objects.equals(expiringEmbedLink, casted.expiringEmbedLink) 357 && Objects.equals(watermarkInfo, casted.watermarkInfo) 358 && Objects.equals(isAccessibleViaSharedLink, casted.isAccessibleViaSharedLink) 359 && Objects.equals(allowedInviteeRoles, casted.allowedInviteeRoles) 360 && Objects.equals(isExternallyOwned, casted.isExternallyOwned) 361 && Objects.equals(hasCollaborations, casted.hasCollaborations) 362 && Objects.equals(metadata, casted.metadata) 363 && Objects.equals(expiresAt, casted.expiresAt) 364 && Objects.equals(representations, casted.representations) 365 && Objects.equals(classification, casted.classification) 366 && Objects.equals(uploaderDisplayName, casted.uploaderDisplayName) 367 && Objects.equals(dispositionAt, casted.dispositionAt) 368 && Objects.equals(sharedLinkPermissionOptions, casted.sharedLinkPermissionOptions) 369 && Objects.equals(isAssociatedWithAppItem, casted.isAssociatedWithAppItem) 370 && Objects.equals(collections, casted.collections) 371 && Objects.equals(isDownloadAvailable, casted.isDownloadAvailable) 372 && Objects.equals(downloadUrl, casted.downloadUrl) 373 && Objects.equals(authenticatedDownloadUrl, casted.authenticatedDownloadUrl) 374 && Objects.equals(allowedSharedLinkAccessLevels, casted.allowedSharedLinkAccessLevels); 375 } 376 377 @Override 378 public int hashCode() { 379 return Objects.hash( 380 id, 381 etag, 382 type, 383 sequenceId, 384 name, 385 sha1, 386 fileVersion, 387 description, 388 size, 389 pathCollection, 390 createdAt, 391 modifiedAt, 392 trashedAt, 393 purgedAt, 394 contentCreatedAt, 395 contentModifiedAt, 396 createdBy, 397 modifiedBy, 398 ownedBy, 399 sharedLink, 400 parent, 401 itemStatus, 402 versionNumber, 403 commentCount, 404 permissions, 405 tags, 406 lock, 407 extension, 408 isPackage, 409 expiringEmbedLink, 410 watermarkInfo, 411 isAccessibleViaSharedLink, 412 allowedInviteeRoles, 413 isExternallyOwned, 414 hasCollaborations, 415 metadata, 416 expiresAt, 417 representations, 418 classification, 419 uploaderDisplayName, 420 dispositionAt, 421 sharedLinkPermissionOptions, 422 isAssociatedWithAppItem, 423 collections, 424 isDownloadAvailable, 425 downloadUrl, 426 authenticatedDownloadUrl, 427 allowedSharedLinkAccessLevels); 428 } 429 430 @Override 431 public String toString() { 432 return "FileFull{" 433 + "id='" 434 + id 435 + '\'' 436 + ", " 437 + "etag='" 438 + etag 439 + '\'' 440 + ", " 441 + "type='" 442 + type 443 + '\'' 444 + ", " 445 + "sequenceId='" 446 + sequenceId 447 + '\'' 448 + ", " 449 + "name='" 450 + name 451 + '\'' 452 + ", " 453 + "sha1='" 454 + sha1 455 + '\'' 456 + ", " 457 + "fileVersion='" 458 + fileVersion 459 + '\'' 460 + ", " 461 + "description='" 462 + description 463 + '\'' 464 + ", " 465 + "size='" 466 + size 467 + '\'' 468 + ", " 469 + "pathCollection='" 470 + pathCollection 471 + '\'' 472 + ", " 473 + "createdAt='" 474 + createdAt 475 + '\'' 476 + ", " 477 + "modifiedAt='" 478 + modifiedAt 479 + '\'' 480 + ", " 481 + "trashedAt='" 482 + trashedAt 483 + '\'' 484 + ", " 485 + "purgedAt='" 486 + purgedAt 487 + '\'' 488 + ", " 489 + "contentCreatedAt='" 490 + contentCreatedAt 491 + '\'' 492 + ", " 493 + "contentModifiedAt='" 494 + contentModifiedAt 495 + '\'' 496 + ", " 497 + "createdBy='" 498 + createdBy 499 + '\'' 500 + ", " 501 + "modifiedBy='" 502 + modifiedBy 503 + '\'' 504 + ", " 505 + "ownedBy='" 506 + ownedBy 507 + '\'' 508 + ", " 509 + "sharedLink='" 510 + sharedLink 511 + '\'' 512 + ", " 513 + "parent='" 514 + parent 515 + '\'' 516 + ", " 517 + "itemStatus='" 518 + itemStatus 519 + '\'' 520 + ", " 521 + "versionNumber='" 522 + versionNumber 523 + '\'' 524 + ", " 525 + "commentCount='" 526 + commentCount 527 + '\'' 528 + ", " 529 + "permissions='" 530 + permissions 531 + '\'' 532 + ", " 533 + "tags='" 534 + tags 535 + '\'' 536 + ", " 537 + "lock='" 538 + lock 539 + '\'' 540 + ", " 541 + "extension='" 542 + extension 543 + '\'' 544 + ", " 545 + "isPackage='" 546 + isPackage 547 + '\'' 548 + ", " 549 + "expiringEmbedLink='" 550 + expiringEmbedLink 551 + '\'' 552 + ", " 553 + "watermarkInfo='" 554 + watermarkInfo 555 + '\'' 556 + ", " 557 + "isAccessibleViaSharedLink='" 558 + isAccessibleViaSharedLink 559 + '\'' 560 + ", " 561 + "allowedInviteeRoles='" 562 + allowedInviteeRoles 563 + '\'' 564 + ", " 565 + "isExternallyOwned='" 566 + isExternallyOwned 567 + '\'' 568 + ", " 569 + "hasCollaborations='" 570 + hasCollaborations 571 + '\'' 572 + ", " 573 + "metadata='" 574 + metadata 575 + '\'' 576 + ", " 577 + "expiresAt='" 578 + expiresAt 579 + '\'' 580 + ", " 581 + "representations='" 582 + representations 583 + '\'' 584 + ", " 585 + "classification='" 586 + classification 587 + '\'' 588 + ", " 589 + "uploaderDisplayName='" 590 + uploaderDisplayName 591 + '\'' 592 + ", " 593 + "dispositionAt='" 594 + dispositionAt 595 + '\'' 596 + ", " 597 + "sharedLinkPermissionOptions='" 598 + sharedLinkPermissionOptions 599 + '\'' 600 + ", " 601 + "isAssociatedWithAppItem='" 602 + isAssociatedWithAppItem 603 + '\'' 604 + ", " 605 + "collections='" 606 + collections 607 + '\'' 608 + ", " 609 + "isDownloadAvailable='" 610 + isDownloadAvailable 611 + '\'' 612 + ", " 613 + "downloadUrl='" 614 + downloadUrl 615 + '\'' 616 + ", " 617 + "authenticatedDownloadUrl='" 618 + authenticatedDownloadUrl 619 + '\'' 620 + ", " 621 + "allowedSharedLinkAccessLevels='" 622 + allowedSharedLinkAccessLevels 623 + '\'' 624 + "}"; 625 } 626 627 public static class Builder extends File.Builder { 628 629 protected String versionNumber; 630 631 protected Long commentCount; 632 633 protected FileFullPermissionsField permissions; 634 635 protected List<String> tags; 636 637 protected FileFullLockField lock; 638 639 protected String extension; 640 641 protected Boolean isPackage; 642 643 protected FileFullExpiringEmbedLinkField expiringEmbedLink; 644 645 protected FileFullWatermarkInfoField watermarkInfo; 646 647 protected Boolean isAccessibleViaSharedLink; 648 649 protected List<EnumWrapper<FileFullAllowedInviteeRolesField>> allowedInviteeRoles; 650 651 protected Boolean isExternallyOwned; 652 653 protected Boolean hasCollaborations; 654 655 protected FileFullMetadataField metadata; 656 657 protected OffsetDateTime expiresAt; 658 659 protected FileFullRepresentationsField representations; 660 661 protected FileFullClassificationField classification; 662 663 protected String uploaderDisplayName; 664 665 protected OffsetDateTime dispositionAt; 666 667 protected List<EnumWrapper<FileFullSharedLinkPermissionOptionsField>> 668 sharedLinkPermissionOptions; 669 670 protected Boolean isAssociatedWithAppItem; 671 672 protected List<Collection> collections; 673 674 protected Boolean isDownloadAvailable; 675 676 protected String downloadUrl; 677 678 protected String authenticatedDownloadUrl; 679 680 protected List<EnumWrapper<FileFullAllowedSharedLinkAccessLevelsField>> 681 allowedSharedLinkAccessLevels; 682 683 public Builder(String id) { 684 super(id); 685 } 686 687 public Builder versionNumber(String versionNumber) { 688 this.versionNumber = versionNumber; 689 return this; 690 } 691 692 public Builder commentCount(Long commentCount) { 693 this.commentCount = commentCount; 694 return this; 695 } 696 697 public Builder permissions(FileFullPermissionsField permissions) { 698 this.permissions = permissions; 699 return this; 700 } 701 702 public Builder tags(List<String> tags) { 703 this.tags = tags; 704 return this; 705 } 706 707 public Builder lock(FileFullLockField lock) { 708 this.lock = lock; 709 this.markNullableFieldAsSet("lock"); 710 return this; 711 } 712 713 public Builder extension(String extension) { 714 this.extension = extension; 715 return this; 716 } 717 718 public Builder isPackage(Boolean isPackage) { 719 this.isPackage = isPackage; 720 return this; 721 } 722 723 public Builder expiringEmbedLink(FileFullExpiringEmbedLinkField expiringEmbedLink) { 724 this.expiringEmbedLink = expiringEmbedLink; 725 return this; 726 } 727 728 public Builder watermarkInfo(FileFullWatermarkInfoField watermarkInfo) { 729 this.watermarkInfo = watermarkInfo; 730 return this; 731 } 732 733 public Builder isAccessibleViaSharedLink(Boolean isAccessibleViaSharedLink) { 734 this.isAccessibleViaSharedLink = isAccessibleViaSharedLink; 735 return this; 736 } 737 738 public Builder allowedInviteeRoles(List<? extends Valuable> allowedInviteeRoles) { 739 this.allowedInviteeRoles = 740 EnumWrapper.wrapValuableEnumList( 741 allowedInviteeRoles, FileFullAllowedInviteeRolesField.class); 742 return this; 743 } 744 745 public Builder isExternallyOwned(Boolean isExternallyOwned) { 746 this.isExternallyOwned = isExternallyOwned; 747 return this; 748 } 749 750 public Builder hasCollaborations(Boolean hasCollaborations) { 751 this.hasCollaborations = hasCollaborations; 752 return this; 753 } 754 755 public Builder metadata(FileFullMetadataField metadata) { 756 this.metadata = metadata; 757 return this; 758 } 759 760 public Builder expiresAt(OffsetDateTime expiresAt) { 761 this.expiresAt = expiresAt; 762 this.markNullableFieldAsSet("expires_at"); 763 return this; 764 } 765 766 public Builder representations(FileFullRepresentationsField representations) { 767 this.representations = representations; 768 return this; 769 } 770 771 public Builder classification(FileFullClassificationField classification) { 772 this.classification = classification; 773 return this; 774 } 775 776 public Builder uploaderDisplayName(String uploaderDisplayName) { 777 this.uploaderDisplayName = uploaderDisplayName; 778 return this; 779 } 780 781 public Builder dispositionAt(OffsetDateTime dispositionAt) { 782 this.dispositionAt = dispositionAt; 783 this.markNullableFieldAsSet("disposition_at"); 784 return this; 785 } 786 787 public Builder sharedLinkPermissionOptions( 788 List<? extends Valuable> sharedLinkPermissionOptions) { 789 this.sharedLinkPermissionOptions = 790 EnumWrapper.wrapValuableEnumList( 791 sharedLinkPermissionOptions, FileFullSharedLinkPermissionOptionsField.class); 792 this.markNullableFieldAsSet("shared_link_permission_options"); 793 return this; 794 } 795 796 public Builder isAssociatedWithAppItem(Boolean isAssociatedWithAppItem) { 797 this.isAssociatedWithAppItem = isAssociatedWithAppItem; 798 return this; 799 } 800 801 public Builder collections(List<Collection> collections) { 802 this.collections = collections; 803 return this; 804 } 805 806 public Builder isDownloadAvailable(Boolean isDownloadAvailable) { 807 this.isDownloadAvailable = isDownloadAvailable; 808 return this; 809 } 810 811 public Builder downloadUrl(String downloadUrl) { 812 this.downloadUrl = downloadUrl; 813 return this; 814 } 815 816 public Builder authenticatedDownloadUrl(String authenticatedDownloadUrl) { 817 this.authenticatedDownloadUrl = authenticatedDownloadUrl; 818 return this; 819 } 820 821 public Builder allowedSharedLinkAccessLevels( 822 List<? extends Valuable> allowedSharedLinkAccessLevels) { 823 this.allowedSharedLinkAccessLevels = 824 EnumWrapper.wrapValuableEnumList( 825 allowedSharedLinkAccessLevels, FileFullAllowedSharedLinkAccessLevelsField.class); 826 return this; 827 } 828 829 @Override 830 public Builder etag(String etag) { 831 this.etag = etag; 832 this.markNullableFieldAsSet("etag"); 833 return this; 834 } 835 836 @Override 837 public Builder type(FileBaseTypeField type) { 838 this.type = new EnumWrapper<FileBaseTypeField>(type); 839 return this; 840 } 841 842 @Override 843 public Builder type(EnumWrapper<FileBaseTypeField> type) { 844 this.type = type; 845 return this; 846 } 847 848 @Override 849 public Builder sequenceId(String sequenceId) { 850 this.sequenceId = sequenceId; 851 return this; 852 } 853 854 @Override 855 public Builder name(String name) { 856 this.name = name; 857 return this; 858 } 859 860 @Override 861 public Builder sha1(String sha1) { 862 this.sha1 = sha1; 863 return this; 864 } 865 866 @Override 867 public Builder fileVersion(FileVersionMini fileVersion) { 868 this.fileVersion = fileVersion; 869 return this; 870 } 871 872 @Override 873 public Builder description(String description) { 874 this.description = description; 875 return this; 876 } 877 878 @Override 879 public Builder size(Long size) { 880 this.size = size; 881 return this; 882 } 883 884 @Override 885 public Builder pathCollection(FilePathCollectionField pathCollection) { 886 this.pathCollection = pathCollection; 887 return this; 888 } 889 890 @Override 891 public Builder createdAt(OffsetDateTime createdAt) { 892 this.createdAt = createdAt; 893 return this; 894 } 895 896 @Override 897 public Builder modifiedAt(OffsetDateTime modifiedAt) { 898 this.modifiedAt = modifiedAt; 899 return this; 900 } 901 902 @Override 903 public Builder trashedAt(OffsetDateTime trashedAt) { 904 this.trashedAt = trashedAt; 905 this.markNullableFieldAsSet("trashed_at"); 906 return this; 907 } 908 909 @Override 910 public Builder purgedAt(OffsetDateTime purgedAt) { 911 this.purgedAt = purgedAt; 912 this.markNullableFieldAsSet("purged_at"); 913 return this; 914 } 915 916 @Override 917 public Builder contentCreatedAt(OffsetDateTime contentCreatedAt) { 918 this.contentCreatedAt = contentCreatedAt; 919 this.markNullableFieldAsSet("content_created_at"); 920 return this; 921 } 922 923 @Override 924 public Builder contentModifiedAt(OffsetDateTime contentModifiedAt) { 925 this.contentModifiedAt = contentModifiedAt; 926 this.markNullableFieldAsSet("content_modified_at"); 927 return this; 928 } 929 930 @Override 931 public Builder createdBy(UserMini createdBy) { 932 this.createdBy = createdBy; 933 return this; 934 } 935 936 @Override 937 public Builder modifiedBy(UserMini modifiedBy) { 938 this.modifiedBy = modifiedBy; 939 return this; 940 } 941 942 @Override 943 public Builder ownedBy(UserMini ownedBy) { 944 this.ownedBy = ownedBy; 945 return this; 946 } 947 948 @Override 949 public Builder sharedLink(FileSharedLinkField sharedLink) { 950 this.sharedLink = sharedLink; 951 return this; 952 } 953 954 @Override 955 public Builder parent(FolderMini parent) { 956 this.parent = parent; 957 this.markNullableFieldAsSet("parent"); 958 return this; 959 } 960 961 @Override 962 public Builder itemStatus(FileItemStatusField itemStatus) { 963 this.itemStatus = new EnumWrapper<FileItemStatusField>(itemStatus); 964 return this; 965 } 966 967 @Override 968 public Builder itemStatus(EnumWrapper<FileItemStatusField> itemStatus) { 969 this.itemStatus = itemStatus; 970 return this; 971 } 972 973 public FileFull build() { 974 if (this.type == null) { 975 this.type = new EnumWrapper<FileBaseTypeField>(FileBaseTypeField.FILE); 976 } 977 return new FileFull(this); 978 } 979 } 980 981 public static class AllowedInviteeRolesDeserializer 982 extends JsonDeserializer<List<EnumWrapper<FileFullAllowedInviteeRolesField>>> { 983 984 public final JsonDeserializer<EnumWrapper<FileFullAllowedInviteeRolesField>> 985 elementDeserializer; 986 987 public AllowedInviteeRolesDeserializer() { 988 super(); 989 this.elementDeserializer = 990 new FileFullAllowedInviteeRolesField.FileFullAllowedInviteeRolesFieldDeserializer(); 991 } 992 993 @Override 994 public List<EnumWrapper<FileFullAllowedInviteeRolesField>> deserialize( 995 JsonParser p, DeserializationContext ctxt) throws IOException { 996 JsonNode node = p.getCodec().readTree(p); 997 List<EnumWrapper<FileFullAllowedInviteeRolesField>> elements = new ArrayList<>(); 998 for (JsonNode item : node) { 999 JsonParser pa = item.traverse(p.getCodec()); 1000 pa.nextToken(); 1001 elements.add(elementDeserializer.deserialize(pa, ctxt)); 1002 } 1003 return elements; 1004 } 1005 } 1006 1007 public static class AllowedInviteeRolesSerializer 1008 extends JsonSerializer<List<EnumWrapper<FileFullAllowedInviteeRolesField>>> { 1009 1010 public final JsonSerializer<EnumWrapper<FileFullAllowedInviteeRolesField>> elementSerializer; 1011 1012 public AllowedInviteeRolesSerializer() { 1013 super(); 1014 this.elementSerializer = 1015 new FileFullAllowedInviteeRolesField.FileFullAllowedInviteeRolesFieldSerializer(); 1016 } 1017 1018 @Override 1019 public void serialize( 1020 List<EnumWrapper<FileFullAllowedInviteeRolesField>> value, 1021 JsonGenerator gen, 1022 SerializerProvider serializers) 1023 throws IOException { 1024 gen.writeStartArray(); 1025 for (EnumWrapper<FileFullAllowedInviteeRolesField> item : value) { 1026 elementSerializer.serialize(item, gen, serializers); 1027 } 1028 gen.writeEndArray(); 1029 } 1030 } 1031 1032 public static class SharedLinkPermissionOptionsDeserializer 1033 extends JsonDeserializer<List<EnumWrapper<FileFullSharedLinkPermissionOptionsField>>> { 1034 1035 public final JsonDeserializer<EnumWrapper<FileFullSharedLinkPermissionOptionsField>> 1036 elementDeserializer; 1037 1038 public SharedLinkPermissionOptionsDeserializer() { 1039 super(); 1040 this.elementDeserializer = 1041 new FileFullSharedLinkPermissionOptionsField 1042 .FileFullSharedLinkPermissionOptionsFieldDeserializer(); 1043 } 1044 1045 @Override 1046 public List<EnumWrapper<FileFullSharedLinkPermissionOptionsField>> deserialize( 1047 JsonParser p, DeserializationContext ctxt) throws IOException { 1048 JsonNode node = p.getCodec().readTree(p); 1049 List<EnumWrapper<FileFullSharedLinkPermissionOptionsField>> elements = new ArrayList<>(); 1050 for (JsonNode item : node) { 1051 JsonParser pa = item.traverse(p.getCodec()); 1052 pa.nextToken(); 1053 elements.add(elementDeserializer.deserialize(pa, ctxt)); 1054 } 1055 return elements; 1056 } 1057 } 1058 1059 public static class SharedLinkPermissionOptionsSerializer 1060 extends JsonSerializer<List<EnumWrapper<FileFullSharedLinkPermissionOptionsField>>> { 1061 1062 public final JsonSerializer<EnumWrapper<FileFullSharedLinkPermissionOptionsField>> 1063 elementSerializer; 1064 1065 public SharedLinkPermissionOptionsSerializer() { 1066 super(); 1067 this.elementSerializer = 1068 new FileFullSharedLinkPermissionOptionsField 1069 .FileFullSharedLinkPermissionOptionsFieldSerializer(); 1070 } 1071 1072 @Override 1073 public void serialize( 1074 List<EnumWrapper<FileFullSharedLinkPermissionOptionsField>> value, 1075 JsonGenerator gen, 1076 SerializerProvider serializers) 1077 throws IOException { 1078 gen.writeStartArray(); 1079 for (EnumWrapper<FileFullSharedLinkPermissionOptionsField> item : value) { 1080 elementSerializer.serialize(item, gen, serializers); 1081 } 1082 gen.writeEndArray(); 1083 } 1084 } 1085 1086 public static class AllowedSharedLinkAccessLevelsDeserializer 1087 extends JsonDeserializer<List<EnumWrapper<FileFullAllowedSharedLinkAccessLevelsField>>> { 1088 1089 public final JsonDeserializer<EnumWrapper<FileFullAllowedSharedLinkAccessLevelsField>> 1090 elementDeserializer; 1091 1092 public AllowedSharedLinkAccessLevelsDeserializer() { 1093 super(); 1094 this.elementDeserializer = 1095 new FileFullAllowedSharedLinkAccessLevelsField 1096 .FileFullAllowedSharedLinkAccessLevelsFieldDeserializer(); 1097 } 1098 1099 @Override 1100 public List<EnumWrapper<FileFullAllowedSharedLinkAccessLevelsField>> deserialize( 1101 JsonParser p, DeserializationContext ctxt) throws IOException { 1102 JsonNode node = p.getCodec().readTree(p); 1103 List<EnumWrapper<FileFullAllowedSharedLinkAccessLevelsField>> elements = new ArrayList<>(); 1104 for (JsonNode item : node) { 1105 JsonParser pa = item.traverse(p.getCodec()); 1106 pa.nextToken(); 1107 elements.add(elementDeserializer.deserialize(pa, ctxt)); 1108 } 1109 return elements; 1110 } 1111 } 1112 1113 public static class AllowedSharedLinkAccessLevelsSerializer 1114 extends JsonSerializer<List<EnumWrapper<FileFullAllowedSharedLinkAccessLevelsField>>> { 1115 1116 public final JsonSerializer<EnumWrapper<FileFullAllowedSharedLinkAccessLevelsField>> 1117 elementSerializer; 1118 1119 public AllowedSharedLinkAccessLevelsSerializer() { 1120 super(); 1121 this.elementSerializer = 1122 new FileFullAllowedSharedLinkAccessLevelsField 1123 .FileFullAllowedSharedLinkAccessLevelsFieldSerializer(); 1124 } 1125 1126 @Override 1127 public void serialize( 1128 List<EnumWrapper<FileFullAllowedSharedLinkAccessLevelsField>> value, 1129 JsonGenerator gen, 1130 SerializerProvider serializers) 1131 throws IOException { 1132 gen.writeStartArray(); 1133 for (EnumWrapper<FileFullAllowedSharedLinkAccessLevelsField> item : value) { 1134 elementSerializer.serialize(item, gen, serializers); 1135 } 1136 gen.writeEndArray(); 1137 } 1138 } 1139}