From d6fd61cc4f335962622e958f6a2996ebbf114770 Mon Sep 17 00:00:00 2001 From: box-sdk-build Date: Fri, 24 Oct 2025 04:20:15 -0700 Subject: [PATCH 1/3] chore: Update `.codegen.json` with commit hash of `codegen` and `openapi` spec [skip ci] --- .codegen.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.codegen.json b/.codegen.json index c4cade9e8..222763a9e 100644 --- a/.codegen.json +++ b/.codegen.json @@ -1 +1 @@ -{ "engineHash": "b98d1dc", "specHash": "cf21406", "version": "10.1.0" } +{ "engineHash": "c4dd2eb", "specHash": "cf21406", "version": "10.1.0" } From 7be1015d7022664902bc639cc3b9bba75f46431e Mon Sep 17 00:00:00 2001 From: box-sdk-build Date: Mon, 27 Oct 2025 08:20:30 -0700 Subject: [PATCH 2/3] feat: use generated `RetryStrategy` for retrying requests (box/box-codegen#872) --- .codegen.json | 2 +- .../com/box/sdkgen/networking/retries/BoxRetryStrategy.java | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.codegen.json b/.codegen.json index 222763a9e..f43109005 100644 --- a/.codegen.json +++ b/.codegen.json @@ -1 +1 @@ -{ "engineHash": "c4dd2eb", "specHash": "cf21406", "version": "10.1.0" } +{ "engineHash": "4421f42", "specHash": "cf21406", "version": "10.1.0" } diff --git a/src/main/java/com/box/sdkgen/networking/retries/BoxRetryStrategy.java b/src/main/java/com/box/sdkgen/networking/retries/BoxRetryStrategy.java index 6c2891681..dcba2d307 100644 --- a/src/main/java/com/box/sdkgen/networking/retries/BoxRetryStrategy.java +++ b/src/main/java/com/box/sdkgen/networking/retries/BoxRetryStrategy.java @@ -36,7 +36,10 @@ public boolean shouldRetry( return attemptNumber <= this.maxRetriesOnException; } boolean isSuccessful = fetchResponse.getStatus() >= 200 && fetchResponse.getStatus() < 400; - String retryAfterHeader = fetchResponse.getHeaders().get("Retry-After"); + String retryAfterHeader = + (fetchResponse.getHeaders().containsKey("Retry-After") + ? fetchResponse.getHeaders().get("Retry-After") + : null); boolean isAcceptedWithRetryAfter = fetchResponse.getStatus() == 202 && !(retryAfterHeader == null); if (attemptNumber >= this.maxAttempts) { From 4dc90f1707342aa98ead621415399e575941e893 Mon Sep 17 00:00:00 2001 From: box-sdk-build Date: Mon, 27 Oct 2025 11:51:44 -0700 Subject: [PATCH 3/3] fix: remove enum types from GET enterprise configurations endpoint (box/box-openapi#560) --- .codegen.json | 2 +- ...seConfigurationByIdV2025R0QueryParams.java | 12 +-- .../CollaborationRestrictionV2025R0.java | 63 -------------- ...V2025R0CollaborationRestrictionsField.java | 76 ++--------------- ...025R0ExternalCollaborationStatusField.java | 42 +--------- ...nalCollaborationStatusFieldValueField.java | 82 ------------------- 6 files changed, 17 insertions(+), 260 deletions(-) delete mode 100644 src/main/java/com/box/sdkgen/schemas/v2025r0/collaborationrestrictionv2025r0/CollaborationRestrictionV2025R0.java delete mode 100644 src/main/java/com/box/sdkgen/schemas/v2025r0/enterpriseconfigurationcontentandsharingv2025r0/EnterpriseConfigurationContentAndSharingV2025R0ExternalCollaborationStatusFieldValueField.java diff --git a/.codegen.json b/.codegen.json index f43109005..d4255002a 100644 --- a/.codegen.json +++ b/.codegen.json @@ -1 +1 @@ -{ "engineHash": "4421f42", "specHash": "cf21406", "version": "10.1.0" } +{ "engineHash": "4421f42", "specHash": "1715587", "version": "10.1.0" } diff --git a/src/main/java/com/box/sdkgen/managers/enterpriseconfigurations/GetEnterpriseConfigurationByIdV2025R0QueryParams.java b/src/main/java/com/box/sdkgen/managers/enterpriseconfigurations/GetEnterpriseConfigurationByIdV2025R0QueryParams.java index 32ff3727b..59a2f1600 100644 --- a/src/main/java/com/box/sdkgen/managers/enterpriseconfigurations/GetEnterpriseConfigurationByIdV2025R0QueryParams.java +++ b/src/main/java/com/box/sdkgen/managers/enterpriseconfigurations/GetEnterpriseConfigurationByIdV2025R0QueryParams.java @@ -1,18 +1,20 @@ package com.box.sdkgen.managers.enterpriseconfigurations; +import java.util.List; + public class GetEnterpriseConfigurationByIdV2025R0QueryParams { /** - * The comma-delimited list of the enterprise configuration categories. Allowed values: - * `security`, `content_and_sharing`, `user_settings`, `shield`. + * A comma-separated list of the enterprise configuration categories. Allowed values: `security`, + * `content_and_sharing`, `user_settings`, `shield`. */ - public final String categories; + public final List categories; - public GetEnterpriseConfigurationByIdV2025R0QueryParams(String categories) { + public GetEnterpriseConfigurationByIdV2025R0QueryParams(List categories) { this.categories = categories; } - public String getCategories() { + public List getCategories() { return categories; } } diff --git a/src/main/java/com/box/sdkgen/schemas/v2025r0/collaborationrestrictionv2025r0/CollaborationRestrictionV2025R0.java b/src/main/java/com/box/sdkgen/schemas/v2025r0/collaborationrestrictionv2025r0/CollaborationRestrictionV2025R0.java deleted file mode 100644 index 779ba985d..000000000 --- a/src/main/java/com/box/sdkgen/schemas/v2025r0/collaborationrestrictionv2025r0/CollaborationRestrictionV2025R0.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.box.sdkgen.schemas.v2025r0.collaborationrestrictionv2025r0; - -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 CollaborationRestrictionV2025R0 implements Valuable { - INTERNAL("internal"), - EXTERNAL("external"); - - private final String value; - - CollaborationRestrictionV2025R0(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static class CollaborationRestrictionV2025R0Deserializer - extends JsonDeserializer> { - - public CollaborationRestrictionV2025R0Deserializer() { - super(); - } - - @Override - public EnumWrapper deserialize( - JsonParser p, DeserializationContext ctxt) throws IOException { - String value = p.getValueAsString(); - return Arrays.stream(CollaborationRestrictionV2025R0.values()) - .filter((v) -> v.getValue().equalsIgnoreCase(value)) - .findFirst() - .map(EnumWrapper::new) - .orElse(new EnumWrapper(value)); - } - } - - public static class CollaborationRestrictionV2025R0Serializer - extends JsonSerializer> { - - public CollaborationRestrictionV2025R0Serializer() { - 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/v2025r0/enterpriseconfigurationcontentandsharingv2025r0/EnterpriseConfigurationContentAndSharingV2025R0CollaborationRestrictionsField.java b/src/main/java/com/box/sdkgen/schemas/v2025r0/enterpriseconfigurationcontentandsharingv2025r0/EnterpriseConfigurationContentAndSharingV2025R0CollaborationRestrictionsField.java index 60211ac36..ddd9f9733 100644 --- a/src/main/java/com/box/sdkgen/schemas/v2025r0/enterpriseconfigurationcontentandsharingv2025r0/EnterpriseConfigurationContentAndSharingV2025R0CollaborationRestrictionsField.java +++ b/src/main/java/com/box/sdkgen/schemas/v2025r0/enterpriseconfigurationcontentandsharingv2025r0/EnterpriseConfigurationContentAndSharingV2025R0CollaborationRestrictionsField.java @@ -1,21 +1,7 @@ package com.box.sdkgen.schemas.v2025r0.enterpriseconfigurationcontentandsharingv2025r0; -import com.box.sdkgen.schemas.v2025r0.collaborationrestrictionv2025r0.CollaborationRestrictionV2025R0; import com.box.sdkgen.schemas.v2025r0.enterpriseconfigurationitemv2025r0.EnterpriseConfigurationItemV2025R0; -import com.box.sdkgen.serialization.json.EnumWrapper; -import com.box.sdkgen.serialization.json.Valuable; import com.fasterxml.jackson.annotation.JsonFilter; -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.JsonNode; -import com.fasterxml.jackson.databind.JsonSerializer; -import com.fasterxml.jackson.databind.SerializerProvider; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; -import java.io.IOException; -import java.util.ArrayList; import java.util.List; import java.util.Objects; @@ -23,9 +9,7 @@ public class EnterpriseConfigurationContentAndSharingV2025R0CollaborationRestrictionsField extends EnterpriseConfigurationItemV2025R0 { - @JsonDeserialize(using = ValueDeserializer.class) - @JsonSerialize(using = ValueSerializer.class) - protected List> value; + protected List value; public EnterpriseConfigurationContentAndSharingV2025R0CollaborationRestrictionsField() { super(); @@ -38,7 +22,7 @@ protected EnterpriseConfigurationContentAndSharingV2025R0CollaborationRestrictio markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); } - public List> getValue() { + public List getValue() { return value; } @@ -75,10 +59,10 @@ public String toString() { public static class Builder extends EnterpriseConfigurationItemV2025R0.Builder { - protected List> value; + protected List value; - public Builder value(List value) { - this.value = EnumWrapper.wrapValuableEnumList(value, CollaborationRestrictionV2025R0.class); + public Builder value(List value) { + this.value = value; return this; } @@ -93,54 +77,4 @@ public EnterpriseConfigurationContentAndSharingV2025R0CollaborationRestrictionsF this); } } - - public static class ValueDeserializer - extends JsonDeserializer>> { - - public final JsonDeserializer> elementDeserializer; - - public ValueDeserializer() { - super(); - this.elementDeserializer = - new CollaborationRestrictionV2025R0.CollaborationRestrictionV2025R0Deserializer(); - } - - @Override - public List> deserialize( - JsonParser p, DeserializationContext ctxt) throws IOException { - JsonNode node = p.getCodec().readTree(p); - List> elements = new ArrayList<>(); - for (JsonNode item : node) { - JsonParser pa = item.traverse(p.getCodec()); - pa.nextToken(); - elements.add(elementDeserializer.deserialize(pa, ctxt)); - } - return elements; - } - } - - public static class ValueSerializer - extends JsonSerializer>> { - - public final JsonSerializer> elementSerializer; - - public ValueSerializer() { - super(); - this.elementSerializer = - new CollaborationRestrictionV2025R0.CollaborationRestrictionV2025R0Serializer(); - } - - @Override - public void serialize( - List> value, - JsonGenerator gen, - SerializerProvider serializers) - throws IOException { - gen.writeStartArray(); - for (EnumWrapper item : value) { - elementSerializer.serialize(item, gen, serializers); - } - gen.writeEndArray(); - } - } } diff --git a/src/main/java/com/box/sdkgen/schemas/v2025r0/enterpriseconfigurationcontentandsharingv2025r0/EnterpriseConfigurationContentAndSharingV2025R0ExternalCollaborationStatusField.java b/src/main/java/com/box/sdkgen/schemas/v2025r0/enterpriseconfigurationcontentandsharingv2025r0/EnterpriseConfigurationContentAndSharingV2025R0ExternalCollaborationStatusField.java index 57b84288a..d04cee9be 100644 --- a/src/main/java/com/box/sdkgen/schemas/v2025r0/enterpriseconfigurationcontentandsharingv2025r0/EnterpriseConfigurationContentAndSharingV2025R0ExternalCollaborationStatusField.java +++ b/src/main/java/com/box/sdkgen/schemas/v2025r0/enterpriseconfigurationcontentandsharingv2025r0/EnterpriseConfigurationContentAndSharingV2025R0ExternalCollaborationStatusField.java @@ -2,10 +2,7 @@ import com.box.sdkgen.internal.Nullable; import com.box.sdkgen.schemas.v2025r0.enterpriseconfigurationitemv2025r0.EnterpriseConfigurationItemV2025R0; -import com.box.sdkgen.serialization.json.EnumWrapper; import com.fasterxml.jackson.annotation.JsonFilter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; import java.util.Objects; @JsonFilter("nullablePropertyFilter") @@ -13,20 +10,7 @@ public class EnterpriseConfigurationContentAndSharingV2025R0ExternalCollaboratio extends EnterpriseConfigurationItemV2025R0 { /** The external collaboration status. */ - @JsonDeserialize( - using = - EnterpriseConfigurationContentAndSharingV2025R0ExternalCollaborationStatusFieldValueField - .EnterpriseConfigurationContentAndSharingV2025R0ExternalCollaborationStatusFieldValueFieldDeserializer - .class) - @JsonSerialize( - using = - EnterpriseConfigurationContentAndSharingV2025R0ExternalCollaborationStatusFieldValueField - .EnterpriseConfigurationContentAndSharingV2025R0ExternalCollaborationStatusFieldValueFieldSerializer - .class) - @Nullable - protected EnumWrapper< - EnterpriseConfigurationContentAndSharingV2025R0ExternalCollaborationStatusFieldValueField> - value; + @Nullable protected String value; public EnterpriseConfigurationContentAndSharingV2025R0ExternalCollaborationStatusField() { super(); @@ -39,9 +23,7 @@ protected EnterpriseConfigurationContentAndSharingV2025R0ExternalCollaborationSt markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); } - public EnumWrapper< - EnterpriseConfigurationContentAndSharingV2025R0ExternalCollaborationStatusFieldValueField> - getValue() { + public String getValue() { return value; } @@ -78,25 +60,9 @@ public String toString() { public static class Builder extends EnterpriseConfigurationItemV2025R0.Builder { - protected EnumWrapper< - EnterpriseConfigurationContentAndSharingV2025R0ExternalCollaborationStatusFieldValueField> - value; + protected String value; - public Builder value( - EnterpriseConfigurationContentAndSharingV2025R0ExternalCollaborationStatusFieldValueField - value) { - this.value = - new EnumWrapper< - EnterpriseConfigurationContentAndSharingV2025R0ExternalCollaborationStatusFieldValueField>( - value); - this.markNullableFieldAsSet("value"); - return this; - } - - public Builder value( - EnumWrapper< - EnterpriseConfigurationContentAndSharingV2025R0ExternalCollaborationStatusFieldValueField> - value) { + public Builder value(String value) { this.value = value; this.markNullableFieldAsSet("value"); return this; diff --git a/src/main/java/com/box/sdkgen/schemas/v2025r0/enterpriseconfigurationcontentandsharingv2025r0/EnterpriseConfigurationContentAndSharingV2025R0ExternalCollaborationStatusFieldValueField.java b/src/main/java/com/box/sdkgen/schemas/v2025r0/enterpriseconfigurationcontentandsharingv2025r0/EnterpriseConfigurationContentAndSharingV2025R0ExternalCollaborationStatusFieldValueField.java deleted file mode 100644 index ca9ed781f..000000000 --- a/src/main/java/com/box/sdkgen/schemas/v2025r0/enterpriseconfigurationcontentandsharingv2025r0/EnterpriseConfigurationContentAndSharingV2025R0ExternalCollaborationStatusFieldValueField.java +++ /dev/null @@ -1,82 +0,0 @@ -package com.box.sdkgen.schemas.v2025r0.enterpriseconfigurationcontentandsharingv2025r0; - -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 - EnterpriseConfigurationContentAndSharingV2025R0ExternalCollaborationStatusFieldValueField - implements Valuable { - ENABLE_EXTERNAL_COLLABORATION("enable_external_collaboration"), - LIMIT_COLLABORATION_TO_ALLOWLISTED_DOMAINS("limit_collaboration_to_allowlisted_domains"); - - private final String value; - - EnterpriseConfigurationContentAndSharingV2025R0ExternalCollaborationStatusFieldValueField( - String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static - class EnterpriseConfigurationContentAndSharingV2025R0ExternalCollaborationStatusFieldValueFieldDeserializer - extends JsonDeserializer< - EnumWrapper< - EnterpriseConfigurationContentAndSharingV2025R0ExternalCollaborationStatusFieldValueField>> { - - public - EnterpriseConfigurationContentAndSharingV2025R0ExternalCollaborationStatusFieldValueFieldDeserializer() { - super(); - } - - @Override - public EnumWrapper< - EnterpriseConfigurationContentAndSharingV2025R0ExternalCollaborationStatusFieldValueField> - deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - String value = p.getValueAsString(); - return Arrays.stream( - EnterpriseConfigurationContentAndSharingV2025R0ExternalCollaborationStatusFieldValueField - .values()) - .filter((v) -> v.getValue().equalsIgnoreCase(value)) - .findFirst() - .map(EnumWrapper::new) - .orElse( - new EnumWrapper< - EnterpriseConfigurationContentAndSharingV2025R0ExternalCollaborationStatusFieldValueField>( - value)); - } - } - - public static - class EnterpriseConfigurationContentAndSharingV2025R0ExternalCollaborationStatusFieldValueFieldSerializer - extends JsonSerializer< - EnumWrapper< - EnterpriseConfigurationContentAndSharingV2025R0ExternalCollaborationStatusFieldValueField>> { - - public - EnterpriseConfigurationContentAndSharingV2025R0ExternalCollaborationStatusFieldValueFieldSerializer() { - super(); - } - - @Override - public void serialize( - EnumWrapper< - EnterpriseConfigurationContentAndSharingV2025R0ExternalCollaborationStatusFieldValueField> - value, - JsonGenerator gen, - SerializerProvider serializers) - throws IOException { - gen.writeString(value.getStringValue()); - } - } -}