diff --git a/.codegen.json b/.codegen.json
index 244dc4a93..5d8d7f751 100644
--- a/.codegen.json
+++ b/.codegen.json
@@ -1 +1 @@
-{ "engineHash": "7c01dda", "specHash": "2bd751f", "version": "5.5.0" }
+{ "engineHash": "7c01dda", "specHash": "74a1e4a", "version": "5.5.0" }
diff --git a/docs/sdkgen/trasheditems.md b/docs/sdkgen/trasheditems.md
index 1643b531d..d48d50648 100644
--- a/docs/sdkgen/trasheditems.md
+++ b/docs/sdkgen/trasheditems.md
@@ -13,7 +13,9 @@ in with the `fields` parameter to retrieve those specific
attributes that are not returned by default.
This endpoint defaults to use offset-based pagination, yet also supports
-marker-based pagination using the `marker` parameter.
+marker-based pagination using the `marker` parameter.
+
+The number of entries returned may be less than `total_count`. For example, if a user deletes items from a shared folder and is later removed as a collaborator, those deleted items will no longer appear in this endpoint’s results, even though they are still included in `total_count`.
This operation is performed by calling function `getTrashedItems`.
diff --git a/src/main/java/com/box/sdkgen/managers/trasheditems/TrashedItemsManager.java b/src/main/java/com/box/sdkgen/managers/trasheditems/TrashedItemsManager.java
index 4f29152a5..2e7d65cd9 100644
--- a/src/main/java/com/box/sdkgen/managers/trasheditems/TrashedItemsManager.java
+++ b/src/main/java/com/box/sdkgen/managers/trasheditems/TrashedItemsManager.java
@@ -38,6 +38,11 @@ protected TrashedItemsManager(Builder builder) {
*
*
This endpoint defaults to use offset-based pagination, yet also supports marker-based
* pagination using the `marker` parameter.
+ *
+ *
The number of entries returned may be less than `total_count`. For example, if a user
+ * deletes items from a shared folder and is later removed as a collaborator, those deleted items
+ * will no longer appear in this endpoint’s results, even though they are still included in
+ * `total_count`.
*/
public Items getTrashedItems() {
return getTrashedItems(new GetTrashedItemsQueryParams(), new GetTrashedItemsHeaders());
@@ -52,6 +57,11 @@ public Items getTrashedItems() {
*
This endpoint defaults to use offset-based pagination, yet also supports marker-based
* pagination using the `marker` parameter.
*
+ *
The number of entries returned may be less than `total_count`. For example, if a user
+ * deletes items from a shared folder and is later removed as a collaborator, those deleted items
+ * will no longer appear in this endpoint’s results, even though they are still included in
+ * `total_count`.
+ *
* @param queryParams Query parameters of getTrashedItems method
*/
public Items getTrashedItems(GetTrashedItemsQueryParams queryParams) {
@@ -67,6 +77,11 @@ public Items getTrashedItems(GetTrashedItemsQueryParams queryParams) {
*
This endpoint defaults to use offset-based pagination, yet also supports marker-based
* pagination using the `marker` parameter.
*
+ *
The number of entries returned may be less than `total_count`. For example, if a user
+ * deletes items from a shared folder and is later removed as a collaborator, those deleted items
+ * will no longer appear in this endpoint’s results, even though they are still included in
+ * `total_count`.
+ *
* @param headers Headers of getTrashedItems method
*/
public Items getTrashedItems(GetTrashedItemsHeaders headers) {
@@ -82,6 +97,11 @@ public Items getTrashedItems(GetTrashedItemsHeaders headers) {
*
This endpoint defaults to use offset-based pagination, yet also supports marker-based
* pagination using the `marker` parameter.
*
+ *
The number of entries returned may be less than `total_count`. For example, if a user
+ * deletes items from a shared folder and is later removed as a collaborator, those deleted items
+ * will no longer appear in this endpoint’s results, even though they are still included in
+ * `total_count`.
+ *
* @param queryParams Query parameters of getTrashedItems method
* @param headers Headers of getTrashedItems method
*/
diff --git a/src/main/java/com/box/sdkgen/schemas/legalholdpolicyassigneditem/LegalHoldPolicyAssignedItem.java b/src/main/java/com/box/sdkgen/schemas/legalholdpolicyassigneditem/LegalHoldPolicyAssignedItem.java
index 57735e084..82f2fda00 100644
--- a/src/main/java/com/box/sdkgen/schemas/legalholdpolicyassigneditem/LegalHoldPolicyAssignedItem.java
+++ b/src/main/java/com/box/sdkgen/schemas/legalholdpolicyassigneditem/LegalHoldPolicyAssignedItem.java
@@ -1,221 +1,79 @@
package com.box.sdkgen.schemas.legalholdpolicyassigneditem;
-import com.box.sdkgen.internal.OneOfThree;
-import com.box.sdkgen.schemas.file.File;
-import com.box.sdkgen.schemas.folder.Folder;
-import com.box.sdkgen.schemas.foldermini.FolderMini;
-import com.box.sdkgen.schemas.usermini.UserMini;
-import com.box.sdkgen.schemas.weblink.WebLink;
+import com.box.sdkgen.internal.SerializableObject;
import com.box.sdkgen.serialization.json.EnumWrapper;
-import com.box.sdkgen.serialization.json.JsonManager;
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import com.fasterxml.jackson.databind.JsonDeserializer;
-import com.fasterxml.jackson.databind.JsonMappingException;
-import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.annotation.JsonFilter;
+import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
-import java.io.IOException;
-import java.time.OffsetDateTime;
-
-@JsonDeserialize(using = LegalHoldPolicyAssignedItem.LegalHoldPolicyAssignedItemDeserializer.class)
-@JsonSerialize(using = OneOfThree.OneOfThreeSerializer.class)
-public class LegalHoldPolicyAssignedItem extends OneOfThree {
-
- protected final String description;
-
- protected final OffsetDateTime createdAt;
-
- protected final OffsetDateTime modifiedAt;
-
- protected final OffsetDateTime trashedAt;
-
- protected final OffsetDateTime purgedAt;
-
- protected final UserMini createdBy;
-
- protected final UserMini modifiedBy;
-
- protected final UserMini ownedBy;
-
- protected final FolderMini parent;
-
- protected final String itemStatus;
-
- protected final String sequenceId;
-
- protected final String name;
-
+import java.util.Objects;
+
+/** The item that the legal hold policy is assigned to. Includes type and ID. */
+@JsonFilter("nullablePropertyFilter")
+public class LegalHoldPolicyAssignedItem extends SerializableObject {
+
+ /** The type of item the policy is assigned to. */
+ @JsonDeserialize(
+ using =
+ LegalHoldPolicyAssignedItemTypeField.LegalHoldPolicyAssignedItemTypeFieldDeserializer
+ .class)
+ @JsonSerialize(
+ using =
+ LegalHoldPolicyAssignedItemTypeField.LegalHoldPolicyAssignedItemTypeFieldSerializer.class)
+ protected final EnumWrapper type;
+
+ /** The ID of the item the policy is assigned to. */
protected final String id;
- protected final String etag;
-
- protected final String type;
-
- public LegalHoldPolicyAssignedItem(File file) {
- super(file, null, null);
- this.description = file.getDescription();
- this.createdAt = file.getCreatedAt();
- this.modifiedAt = file.getModifiedAt();
- this.trashedAt = file.getTrashedAt();
- this.purgedAt = file.getPurgedAt();
- this.createdBy = file.getCreatedBy();
- this.modifiedBy = file.getModifiedBy();
- this.ownedBy = file.getOwnedBy();
- this.parent = file.getParent();
- this.itemStatus = EnumWrapper.convertToString(file.getItemStatus());
- this.sequenceId = file.getSequenceId();
- this.name = file.getName();
- this.id = file.getId();
- this.etag = file.getEtag();
- this.type = EnumWrapper.convertToString(file.getType());
- }
-
- public LegalHoldPolicyAssignedItem(Folder folder) {
- super(null, folder, null);
- this.description = folder.getDescription();
- this.createdAt = folder.getCreatedAt();
- this.modifiedAt = folder.getModifiedAt();
- this.trashedAt = folder.getTrashedAt();
- this.purgedAt = folder.getPurgedAt();
- this.createdBy = folder.getCreatedBy();
- this.modifiedBy = folder.getModifiedBy();
- this.ownedBy = folder.getOwnedBy();
- this.parent = folder.getParent();
- this.itemStatus = EnumWrapper.convertToString(folder.getItemStatus());
- this.sequenceId = folder.getSequenceId();
- this.name = folder.getName();
- this.id = folder.getId();
- this.etag = folder.getEtag();
- this.type = EnumWrapper.convertToString(folder.getType());
- }
-
- public LegalHoldPolicyAssignedItem(WebLink webLink) {
- super(null, null, webLink);
- this.description = webLink.getDescription();
- this.createdAt = webLink.getCreatedAt();
- this.modifiedAt = webLink.getModifiedAt();
- this.trashedAt = webLink.getTrashedAt();
- this.purgedAt = webLink.getPurgedAt();
- this.createdBy = webLink.getCreatedBy();
- this.modifiedBy = webLink.getModifiedBy();
- this.ownedBy = webLink.getOwnedBy();
- this.parent = webLink.getParent();
- this.itemStatus = EnumWrapper.convertToString(webLink.getItemStatus());
- this.sequenceId = webLink.getSequenceId();
- this.name = webLink.getName();
- this.id = webLink.getId();
- this.etag = webLink.getEtag();
- this.type = EnumWrapper.convertToString(webLink.getType());
- }
-
- public boolean isFile() {
- return value0 != null;
- }
-
- public File getFile() {
- return value0;
- }
-
- public boolean isFolder() {
- return value1 != null;
- }
-
- public Folder getFolder() {
- return value1;
- }
-
- public boolean isWebLink() {
- return value2 != null;
+ public LegalHoldPolicyAssignedItem(LegalHoldPolicyAssignedItemTypeField type, String id) {
+ super();
+ this.type = new EnumWrapper(type);
+ this.id = id;
}
- public WebLink getWebLink() {
- return value2;
+ public LegalHoldPolicyAssignedItem(
+ @JsonProperty("type") EnumWrapper type,
+ @JsonProperty("id") String id) {
+ super();
+ this.type = type;
+ this.id = id;
}
- public String getDescription() {
- return description;
- }
-
- public OffsetDateTime getCreatedAt() {
- return createdAt;
- }
-
- public OffsetDateTime getModifiedAt() {
- return modifiedAt;
- }
-
- public OffsetDateTime getTrashedAt() {
- return trashedAt;
- }
-
- public OffsetDateTime getPurgedAt() {
- return purgedAt;
- }
-
- public UserMini getCreatedBy() {
- return createdBy;
- }
-
- public UserMini getModifiedBy() {
- return modifiedBy;
- }
-
- public UserMini getOwnedBy() {
- return ownedBy;
- }
-
- public FolderMini getParent() {
- return parent;
- }
-
- public String getItemStatus() {
- return itemStatus;
- }
-
- public String getSequenceId() {
- return sequenceId;
- }
-
- public String getName() {
- return name;
+ public EnumWrapper getType() {
+ return type;
}
public String getId() {
return id;
}
- public String getEtag() {
- return etag;
- }
-
- public String getType() {
- return type;
- }
-
- static class LegalHoldPolicyAssignedItemDeserializer
- extends JsonDeserializer {
-
- public LegalHoldPolicyAssignedItemDeserializer() {
- super();
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
}
-
- @Override
- public LegalHoldPolicyAssignedItem deserialize(JsonParser jp, DeserializationContext ctxt)
- throws IOException {
- JsonNode node = JsonManager.jsonToSerializedData(jp);
- JsonNode discriminant0 = node.get("type");
- if (!(discriminant0 == null)) {
- switch (discriminant0.asText()) {
- case "file":
- return new LegalHoldPolicyAssignedItem(JsonManager.deserialize(node, File.class));
- case "folder":
- return new LegalHoldPolicyAssignedItem(JsonManager.deserialize(node, Folder.class));
- case "web_link":
- return new LegalHoldPolicyAssignedItem(JsonManager.deserialize(node, WebLink.class));
- }
- }
- throw new JsonMappingException(jp, "Unable to deserialize LegalHoldPolicyAssignedItem");
+ if (o == null || getClass() != o.getClass()) {
+ return false;
}
+ LegalHoldPolicyAssignedItem casted = (LegalHoldPolicyAssignedItem) o;
+ return Objects.equals(type, casted.type) && Objects.equals(id, casted.id);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(type, id);
+ }
+
+ @Override
+ public String toString() {
+ return "LegalHoldPolicyAssignedItem{"
+ + "type='"
+ + type
+ + '\''
+ + ", "
+ + "id='"
+ + id
+ + '\''
+ + "}";
}
}
diff --git a/src/main/java/com/box/sdkgen/schemas/legalholdpolicyassigneditem/LegalHoldPolicyAssignedItemTypeField.java b/src/main/java/com/box/sdkgen/schemas/legalholdpolicyassigneditem/LegalHoldPolicyAssignedItemTypeField.java
new file mode 100644
index 000000000..00c8965bd
--- /dev/null
+++ b/src/main/java/com/box/sdkgen/schemas/legalholdpolicyassigneditem/LegalHoldPolicyAssignedItemTypeField.java
@@ -0,0 +1,67 @@
+package com.box.sdkgen.schemas.legalholdpolicyassigneditem;
+
+import com.box.sdkgen.serialization.json.EnumWrapper;
+import com.box.sdkgen.serialization.json.Valuable;
+import com.fasterxml.jackson.core.JsonGenerator;
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import com.fasterxml.jackson.databind.JsonDeserializer;
+import com.fasterxml.jackson.databind.JsonSerializer;
+import com.fasterxml.jackson.databind.SerializerProvider;
+import java.io.IOException;
+import java.util.Arrays;
+
+public enum LegalHoldPolicyAssignedItemTypeField implements Valuable {
+ FILE("file"),
+ FILE_VERSION("file_version"),
+ FOLDER("folder"),
+ USER("user"),
+ OWNERSHIP("ownership"),
+ INTERACTIONS("interactions");
+
+ private final String value;
+
+ LegalHoldPolicyAssignedItemTypeField(String value) {
+ this.value = value;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public static class LegalHoldPolicyAssignedItemTypeFieldDeserializer
+ extends JsonDeserializer> {
+
+ public LegalHoldPolicyAssignedItemTypeFieldDeserializer() {
+ super();
+ }
+
+ @Override
+ public EnumWrapper deserialize(
+ JsonParser p, DeserializationContext ctxt) throws IOException {
+ String value = p.getValueAsString();
+ return Arrays.stream(LegalHoldPolicyAssignedItemTypeField.values())
+ .filter((v) -> v.getValue().equalsIgnoreCase(value))
+ .findFirst()
+ .map(EnumWrapper::new)
+ .orElse(new EnumWrapper(value));
+ }
+ }
+
+ public static class LegalHoldPolicyAssignedItemTypeFieldSerializer
+ extends JsonSerializer> {
+
+ public LegalHoldPolicyAssignedItemTypeFieldSerializer() {
+ super();
+ }
+
+ @Override
+ public void serialize(
+ EnumWrapper value,
+ JsonGenerator gen,
+ SerializerProvider serializers)
+ throws IOException {
+ gen.writeString(value.getStringValue());
+ }
+ }
+}
diff --git a/src/main/java/com/box/sdkgen/schemas/legalholdpolicyassignment/LegalHoldPolicyAssignment.java b/src/main/java/com/box/sdkgen/schemas/legalholdpolicyassignment/LegalHoldPolicyAssignment.java
index 092811ec2..6a1a1db1f 100644
--- a/src/main/java/com/box/sdkgen/schemas/legalholdpolicyassignment/LegalHoldPolicyAssignment.java
+++ b/src/main/java/com/box/sdkgen/schemas/legalholdpolicyassignment/LegalHoldPolicyAssignment.java
@@ -1,14 +1,11 @@
package com.box.sdkgen.schemas.legalholdpolicyassignment;
import com.box.sdkgen.internal.utils.DateTimeUtils;
-import com.box.sdkgen.schemas.file.File;
-import com.box.sdkgen.schemas.folder.Folder;
import com.box.sdkgen.schemas.legalholdpolicyassigneditem.LegalHoldPolicyAssignedItem;
import com.box.sdkgen.schemas.legalholdpolicyassignmentbase.LegalHoldPolicyAssignmentBase;
import com.box.sdkgen.schemas.legalholdpolicyassignmentbase.LegalHoldPolicyAssignmentBaseTypeField;
import com.box.sdkgen.schemas.legalholdpolicymini.LegalHoldPolicyMini;
import com.box.sdkgen.schemas.usermini.UserMini;
-import com.box.sdkgen.schemas.weblink.WebLink;
import com.box.sdkgen.serialization.json.EnumWrapper;
import com.fasterxml.jackson.annotation.JsonFilter;
import com.fasterxml.jackson.annotation.JsonProperty;
@@ -18,8 +15,8 @@
import java.util.Objects;
/**
- * Legal Hold Assignments are used to assign Legal Hold Policies to Users, Folders, Files, or File
- * Versions.
+ * Legal Hold Assignments are used to assign Legal Hold Policies to an item type of: Users, Folders,
+ * Files, File Versions, Ownership, or Interactions.
*
* Creating a Legal Hold Assignment puts a hold on the File-Versions that belong to the
* Assignment's 'apply-to' entity.
@@ -159,21 +156,6 @@ public Builder legalHoldPolicy(LegalHoldPolicyMini legalHoldPolicy) {
return this;
}
- public Builder assignedTo(File assignedTo) {
- this.assignedTo = new LegalHoldPolicyAssignedItem(assignedTo);
- return this;
- }
-
- public Builder assignedTo(Folder assignedTo) {
- this.assignedTo = new LegalHoldPolicyAssignedItem(assignedTo);
- return this;
- }
-
- public Builder assignedTo(WebLink assignedTo) {
- this.assignedTo = new LegalHoldPolicyAssignedItem(assignedTo);
- return this;
- }
-
public Builder assignedTo(LegalHoldPolicyAssignedItem assignedTo) {
this.assignedTo = assignedTo;
return this;