diff --git a/.codegen.json b/.codegen.json index 4130666af..ec47975ea 100644 --- a/.codegen.json +++ b/.codegen.json @@ -1 +1 @@ -{ "engineHash": "12f2054", "specHash": "5bf3652", "version": "0.1.0" } +{ "engineHash": "f39bd50", "specHash": "bad862d", "version": "0.1.0" } diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 8117147a7..673dfbff9 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,14 +1,14 @@ blank_issues_enabled: false contact_links: - name: SDK documentation - url: https://github.com/box/box-java-sdk-gen/tree/main/docs + url: https://github.com/box/box-java-sdk/tree/sdk-gen/docs about: Before creating an issue, I have checked that the SDK documentation doesn't solve my issue. - name: API documentation url: https://developer.box.com/docs about: Before creating an issue, I have checked that the API documentation doesn't solve my issue. - name: Box Developer Forums - url: https://community.box.com/t5/Platform-and-Development-Forum/bd-p/DeveloperForum + url: https://community.box.com/box-platform-5 about: Before creating an issue, I have searched the Box Developer Forums and my issue isn't already reported there. - name: Issues in this repo - url: https://github.com/box/box-java-sdk-gen/search?type=Issues + url: https://github.com/box/box-java-sdk/search?type=Issues about: Before creating an issue, I have searched Issues in this repo and my issue isn't already reported. diff --git a/.github/workflows/autoupdate-pr.yml b/.github/workflows/autoupdate-pr.yml index 185ab949d..080c51c32 100644 --- a/.github/workflows/autoupdate-pr.yml +++ b/.github/workflows/autoupdate-pr.yml @@ -2,7 +2,7 @@ name: Autoupdate PR on: push: branches: - - main + - sdk-gen jobs: update_pull_requests: diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 61e1b7806..2cfcb2ba9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,10 +1,11 @@ name: build on: pull_request: - types: [opened, synchronize] + branches: + - sdk-gen push: branches: - - main + - sdk-gen jobs: build-and-test: runs-on: ubuntu-latest diff --git a/.github/workflows/notify-changelog.yml b/.github/workflows/notify-changelog.yml index b54a043bf..fec9ec4ff 100644 --- a/.github/workflows/notify-changelog.yml +++ b/.github/workflows/notify-changelog.yml @@ -24,4 +24,4 @@ jobs: token: ${{ secrets.DISPATCH_ACCESS_TOKEN }} repository: box/box-developer-changelog event-type: new-release-note - client-payload: '{"ref": "${{ github.ref }}", "repository": "${{github.repository}}", "labels": "sdks,java", "repo_display_name": "Box Java SDK Generated"}' + client-payload: '{"ref": "${{ github.ref }}", "repository": "${{github.repository}}", "labels": "sdks,java", "repo_display_name": "Box Java SDK"}' diff --git a/.github/workflows/semantic-pr.yml b/.github/workflows/semantic-pr.yml index cbff636c5..de1b2c83c 100644 --- a/.github/workflows/semantic-pr.yml +++ b/.github/workflows/semantic-pr.yml @@ -6,6 +6,8 @@ on: - opened - edited - synchronize + branches: + - sdk-gen jobs: main: diff --git a/.github/workflows/spell-check-lint.yml b/.github/workflows/spell-check-lint.yml index 659bbd3fa..6bcfc58e4 100644 --- a/.github/workflows/spell-check-lint.yml +++ b/.github/workflows/spell-check-lint.yml @@ -3,7 +3,7 @@ on: pull_request_target: types: [opened, synchronize, edited] branches: - - main + - sdk-gen jobs: spellcheck-request: runs-on: ubuntu-latest diff --git a/docs/archives.md b/docs/archives.md index d0a2f7b9c..173edd0c6 100644 --- a/docs/archives.md +++ b/docs/archives.md @@ -9,6 +9,8 @@ Retrieves archives for an enterprise. +To learn more about the archive APIs, see the [Archive API Guide](g://archives). + This operation is performed by calling function `getArchivesV2025R0`. See the endpoint docs at @@ -38,6 +40,8 @@ Returns a list of archives in the enterprise. Creates an archive. +To learn more about the archive APIs, see the [Archive API Guide](g://archives). + This operation is performed by calling function `createArchiveV2025R0`. See the endpoint docs at @@ -67,6 +71,8 @@ Returns a new archive object. Permanently deletes an archive. +To learn more about the archive APIs, see the [Archive API Guide](g://archives). + This operation is performed by calling function `deleteArchiveByIdV2025R0`. See the endpoint docs at diff --git a/docs/docgen.md b/docs/docgen.md index d7246e4df..ad7ad936f 100644 --- a/docs/docgen.md +++ b/docs/docgen.md @@ -46,7 +46,7 @@ See the endpoint docs at ``` -client.getDocgen().getDocgenJobsV2025R0(new GetDocgenJobsV2025R0QueryParams.Builder().limit(500L).build()) +client.getDocgen().getDocgenJobsV2025R0(new GetDocgenJobsV2025R0QueryParams.Builder().limit(10000L).build()) ``` ### Arguments diff --git a/src/main/java/com/box/sdkgen/schemas/v2025r0/userreferencev2025r0/UserReferenceV2025R0.java b/src/main/java/com/box/sdkgen/schemas/v2025r0/userreferencev2025r0/UserReferenceV2025R0.java new file mode 100644 index 000000000..f47964532 --- /dev/null +++ b/src/main/java/com/box/sdkgen/schemas/v2025r0/userreferencev2025r0/UserReferenceV2025R0.java @@ -0,0 +1,93 @@ +package com.box.sdkgen.schemas.v2025r0.userreferencev2025r0; + +import com.box.sdkgen.internal.NullableFieldTracker; +import com.box.sdkgen.internal.SerializableObject; +import com.box.sdkgen.serialization.json.EnumWrapper; +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.util.Objects; + +@JsonFilter("nullablePropertyFilter") +public class UserReferenceV2025R0 extends SerializableObject { + + @JsonDeserialize( + using = UserReferenceV2025R0TypeField.UserReferenceV2025R0TypeFieldDeserializer.class) + @JsonSerialize( + using = UserReferenceV2025R0TypeField.UserReferenceV2025R0TypeFieldSerializer.class) + protected EnumWrapper type; + + protected final String id; + + public UserReferenceV2025R0(@JsonProperty("id") String id) { + super(); + this.id = id; + this.type = new EnumWrapper(UserReferenceV2025R0TypeField.USER); + } + + protected UserReferenceV2025R0(Builder builder) { + super(); + this.type = builder.type; + this.id = builder.id; + markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); + } + + public EnumWrapper getType() { + return type; + } + + public String getId() { + return id; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserReferenceV2025R0 casted = (UserReferenceV2025R0) 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 "UserReferenceV2025R0{" + "type='" + type + '\'' + ", " + "id='" + id + '\'' + "}"; + } + + public static class Builder extends NullableFieldTracker { + + protected EnumWrapper type; + + protected final String id; + + public Builder(String id) { + super(); + this.id = id; + this.type = + new EnumWrapper(UserReferenceV2025R0TypeField.USER); + } + + public Builder type(UserReferenceV2025R0TypeField type) { + this.type = new EnumWrapper(type); + return this; + } + + public Builder type(EnumWrapper type) { + this.type = type; + return this; + } + + public UserReferenceV2025R0 build() { + return new UserReferenceV2025R0(this); + } + } +} diff --git a/src/main/java/com/box/sdkgen/schemas/v2025r0/userreferencev2025r0/UserReferenceV2025R0TypeField.java b/src/main/java/com/box/sdkgen/schemas/v2025r0/userreferencev2025r0/UserReferenceV2025R0TypeField.java new file mode 100644 index 000000000..e930f325a --- /dev/null +++ b/src/main/java/com/box/sdkgen/schemas/v2025r0/userreferencev2025r0/UserReferenceV2025R0TypeField.java @@ -0,0 +1,62 @@ +package com.box.sdkgen.schemas.v2025r0.userreferencev2025r0; + +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 UserReferenceV2025R0TypeField implements Valuable { + USER("user"); + + private final String value; + + UserReferenceV2025R0TypeField(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static class UserReferenceV2025R0TypeFieldDeserializer + extends JsonDeserializer> { + + public UserReferenceV2025R0TypeFieldDeserializer() { + super(); + } + + @Override + public EnumWrapper deserialize( + JsonParser p, DeserializationContext ctxt) throws IOException { + String value = p.getValueAsString(); + return Arrays.stream(UserReferenceV2025R0TypeField.values()) + .filter((v) -> v.getValue().equalsIgnoreCase(value)) + .findFirst() + .map(EnumWrapper::new) + .orElse(new EnumWrapper(value)); + } + } + + public static class UserReferenceV2025R0TypeFieldSerializer + extends JsonSerializer> { + + public UserReferenceV2025R0TypeFieldSerializer() { + super(); + } + + @Override + public void serialize( + EnumWrapper value, + JsonGenerator gen, + SerializerProvider serializers) + throws IOException { + gen.writeString(value.getStringValue()); + } + } +} diff --git a/src/test/java/com/box/sdkgen/test/docgen/DocgenITest.java b/src/test/java/com/box/sdkgen/test/docgen/DocgenITest.java index bc0b96787..dd05c2df5 100644 --- a/src/test/java/com/box/sdkgen/test/docgen/DocgenITest.java +++ b/src/test/java/com/box/sdkgen/test/docgen/DocgenITest.java @@ -71,7 +71,7 @@ public void testDocgenBatchAndJobs() { client .getDocgen() .getDocgenJobsV2025R0( - new GetDocgenJobsV2025R0QueryParams.Builder().limit(500L).build()); + new GetDocgenJobsV2025R0QueryParams.Builder().limit(10000L).build()); assert docgenJobs.getEntries().size() >= 1; assert !(docgenJobs.getEntries().get(0).getBatch().getId().equals("")); assert !(docgenJobs.getEntries().get(0).getCreatedBy().getId().equals("")); @@ -87,7 +87,7 @@ assert convertToString(docgenJobs.getEntries().get(0).getTemplateFileVersion().g .equals("file_version"); assert !(docgenJobs.getEntries().get(0).getTemplateFileVersion().getId().equals("")); assert convertToString(docgenJobs.getEntries().get(0).getType()).equals("docgen_job"); - int indexOfItem = 0; + int indexOfItem = docgenJobs.getEntries().size() - 1; DocGenJobFullV2025R0 docgenJobItemFromList = docgenJobs.getEntries().get(indexOfItem); DocGenJobV2025R0 docgenJob = client.getDocgen().getDocgenJobByIdV2025R0(docgenJobItemFromList.getId());