diff --git a/README.md b/README.md index cd699f4..c37f729 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ The client can be used with Java 1.8+ and pulled into Maven or Gradle projects. com.vertexvis api-client-java - 0.15.0 + 0.16.0 compile ``` @@ -25,13 +25,13 @@ The client can be used with Java 1.8+ and pulled into Maven or Gradle projects. ### Gradle ```groovy -compile "com.vertexvis:api-client-java:0.15.0" +compile "com.vertexvis:api-client-java:0.16.0" ``` ### Sbt ```sbt -libraryDependencies += "com.vertexvis" % "api-client-java" % "0.15.0" +libraryDependencies += "com.vertexvis" % "api-client-java" % "0.16.0" ``` ### Others @@ -44,7 +44,7 @@ mvn clean package Then manually install the following JARs. -- `target/api-client-java-0.15.0.jar` +- `target/api-client-java-0.16.0.jar` - `target/lib/*.jar` ## Usage @@ -104,7 +104,7 @@ To consume published snapshot versions in other projects, add the snapshot repos com.vertexvis api-client-java - 0.15.0-SNAPSHOT + 0.16.0-SNAPSHOT ``` @@ -119,7 +119,7 @@ repositories { } dependencies { - implementation 'com.vertexvis:api-client-java:0.15.0-SNAPSHOT' + implementation 'com.vertexvis:api-client-java:0.16.0-SNAPSHOT' } ``` diff --git a/build.gradle b/build.gradle index 5b79e91..7cc1604 100644 --- a/build.gradle +++ b/build.gradle @@ -3,7 +3,7 @@ plugins { id "io.github.gradle-nexus.publish-plugin" } -def projectVersion = '0.15.0' +def projectVersion = '0.16.0' def isSnapshot = project.hasProperty('isSnapshot') && project.isSnapshot.toBoolean() version = isSnapshot ? "${projectVersion}-SNAPSHOT" : projectVersion diff --git a/examples/src/main/java/com/vertexvis/example/PartCreator.java b/examples/src/main/java/com/vertexvis/example/PartCreator.java index 2977284..bb0a045 100644 --- a/examples/src/main/java/com/vertexvis/example/PartCreator.java +++ b/examples/src/main/java/com/vertexvis/example/PartCreator.java @@ -59,11 +59,11 @@ private static CreatePartRequest getCreatePartRequest(UUID fileId, String partNa private static CreatePartRequest createPartAssemblyRequest(List revisionIds, String assemblyName) { - PartAssemblyRelationship partAssemblyRelationship = new PartAssemblyRelationship() - .data(new PartAssemblyRelationshipData() - .metadata(Collections.emptyMap()) - .children(createPartRevisionInstances(revisionIds)) + CreatePartRequestDataRelationships partAssemblyRelationship = new CreatePartRequestDataRelationships() + .instances(new PartInstancesRelationship() + .data(createPartRevisionInstances(revisionIds)) ); + var uuid = UUID.randomUUID(); return new CreatePartRequest() .data( @@ -73,23 +73,20 @@ private static CreatePartRequest createPartAssemblyRequest(List revisionId .suppliedId("my-assembly-" + uuid) .suppliedRevisionId("my-part-rev-" + uuid) .name(assemblyName)) - .relationships(new CreatePartRequestDataRelationships() - .source(new CreatePartRequestDataRelationshipsSource(partAssemblyRelationship)) - )); + .relationships(partAssemblyRelationship)); } - private static List createPartRevisionInstances(List ids) { - int num = ids.size(); - return IntStream.range(0, num) - .mapToObj(ordinal -> new PartRevisionInstance(). - ordinal(ordinal) - .revisionId(ids.get(ordinal)) - .transform(new Matrix4() + private static List createPartRevisionInstances(List ids) { + return ids.stream().map(id -> new PartInstancesRelationshipData() + .type(PartInstancesRelationshipData.TypeEnum.PART_REVISION_INSTANCE) + .id(id) + .attributes(new PartInstancesRelationshipAttributes().transform(new Matrix4() .r0(createVector4(BigDecimal.ONE, BigDecimal.ZERO, BigDecimal.ZERO, BigDecimal.ONE)) .r1(createVector4(BigDecimal.ZERO, BigDecimal.ONE, BigDecimal.ZERO, BigDecimal.ONE)) .r2(createVector4(BigDecimal.ZERO, BigDecimal.ZERO, BigDecimal.ONE, BigDecimal.ONE)) .r3(createVector4(BigDecimal.ZERO, BigDecimal.ZERO, BigDecimal.ZERO, BigDecimal.ONE)) )) + ) .collect(Collectors.toList()); }