diff --git a/.fern/metadata.json b/.fern/metadata.json index e3b2a98..7088177 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -1,5 +1,5 @@ { - "cliVersion": "5.5.1", + "cliVersion": "5.10.2", "generatorName": "fernapi/fern-java-sdk", "generatorVersion": "4.6.1", "generatorConfig": { @@ -9,10 +9,10 @@ "client-class-name": "Junction", "enable-forward-compatible-enums": true }, - "originGitCommit": "05d79dd6ce370cbd029417f59eb71c056d94aa61", + "originGitCommit": "5f82089cf81f14dcaa4eabeffe1c781fb1679c6e", "originGitCommitIsDirty": true, "invokedBy": "ci", "requestedVersion": "AUTO", "ciProvider": "unknown", - "sdkVersion": "0.0.1" + "sdkVersion": "1.0.0" } \ No newline at end of file diff --git a/README.md b/README.md index 94eb4cd..52fcf13 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ Add the dependency in your `build.gradle` file: ```groovy dependencies { - implementation 'com.junction:junction-java:0.0.1' + implementation 'com.junction:junction-java:1.0.0' } ``` @@ -41,7 +41,7 @@ Add the dependency in your `pom.xml` file: com.junction junction-java - 0.0.1 + 1.0.0 ``` diff --git a/build.gradle b/build.gradle index 1797e49..31b2970 100644 --- a/build.gradle +++ b/build.gradle @@ -47,7 +47,7 @@ java { group = 'com.junction' -version = '0.0.1' +version = '1.0.0' jar { dependsOn(":generatePomFileForMavenPublication") @@ -78,7 +78,7 @@ publishing { maven(MavenPublication) { groupId = 'com.junction' artifactId = 'junction-java' - version = '0.0.1' + version = '1.0.0' from components.java pom { name = 'vital' diff --git a/changelog.md b/changelog.md index 9f803cf..805a65d 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,13 @@ +## 1.0.0 - 2026-05-05 +### Breaking Changes +* **`MealInDbBaseClientFacingSource.Builder`** — `timestamp()` now returns `CalendarDateStage` instead of `NameStage`, inserting a new required `calendarDate(String)` step in the builder chain. Migrate by adding `.calendarDate("YYYY-MM-DD")` between `.timestamp(...)` and `.name(...)`. +### Added +* **`LabReportResult`** — new optional `getSampleType()` (`LabReportResultSampleType`) and `getMeasurementKind()` (`LabReportResultMeasurementKind`) fields, with corresponding builder methods. +* **`LabReportResultSampleType`** — new non-exhaustive enum type representing the biological sample type (e.g. `URINE`, `SERUM_PLASMA_BLOOD`, `STOOL`, `SALIVA`). +* **`LabReportResultMeasurementKind`** — new non-exhaustive enum type representing how a lab value was derived (e.g. `DIRECT`, `CALCULATED`, `RATIO`). +### Changed +* **`Environment`** — all base URLs updated from `tryvital.io` to `junction.com` domains (`PRODUCTION`, `PRODUCTION_EU`, `SANDBOX`, `SANDBOX_EU`). + ## 0.0.1 - 2026-05-01 * Initial SDK generation * 🌿 Generated with Fern diff --git a/src/main/java/com/junction/api/core/ClientOptions.java b/src/main/java/com/junction/api/core/ClientOptions.java index 8626ce6..d699afb 100644 --- a/src/main/java/com/junction/api/core/ClientOptions.java +++ b/src/main/java/com/junction/api/core/ClientOptions.java @@ -38,10 +38,10 @@ private ClientOptions( this.headers.putAll(headers); this.headers.putAll(new HashMap() { { - put("User-Agent", "com.junction:junction-java/0.0.1"); + put("User-Agent", "com.junction:junction-java/1.0.0"); put("X-Fern-Language", "JAVA"); put("X-Fern-SDK-Name", "com.vital.fern:api-sdk"); - put("X-Fern-SDK-Version", "0.0.1"); + put("X-Fern-SDK-Version", "1.0.0"); } }); this.headerSuppliers = headerSuppliers; diff --git a/src/main/java/com/junction/api/core/Environment.java b/src/main/java/com/junction/api/core/Environment.java index 61ef520..eb0a713 100644 --- a/src/main/java/com/junction/api/core/Environment.java +++ b/src/main/java/com/junction/api/core/Environment.java @@ -4,13 +4,13 @@ package com.junction.api.core; public final class Environment { - public static final Environment PRODUCTION = new Environment("https://api.tryvital.io"); + public static final Environment PRODUCTION = new Environment("https://api.us.junction.com"); - public static final Environment PRODUCTION_EU = new Environment("https://api.eu.tryvital.io"); + public static final Environment PRODUCTION_EU = new Environment("https://api.eu.junction.com"); - public static final Environment SANDBOX = new Environment("https://api.sandbox.tryvital.io"); + public static final Environment SANDBOX = new Environment("https://api.sandbox.us.junction.com"); - public static final Environment SANDBOX_EU = new Environment("https://api.sandbox.eu.tryvital.io"); + public static final Environment SANDBOX_EU = new Environment("https://api.sandbox.eu.junction.com"); private final String url; diff --git a/src/main/java/com/junction/api/types/LabReportResult.java b/src/main/java/com/junction/api/types/LabReportResult.java index 6879add..167e179 100644 --- a/src/main/java/com/junction/api/types/LabReportResult.java +++ b/src/main/java/com/junction/api/types/LabReportResult.java @@ -29,6 +29,10 @@ public final class LabReportResult { private final String value; + private final Optional sampleType; + + private final Optional measurementKind; + private final Optional type; private final Optional units; @@ -52,6 +56,8 @@ public final class LabReportResult { private LabReportResult( String testName, String value, + Optional sampleType, + Optional measurementKind, Optional type, Optional units, Optional maxReferenceRange, @@ -64,6 +70,8 @@ private LabReportResult( Map additionalProperties) { this.testName = testName; this.value = value; + this.sampleType = sampleType; + this.measurementKind = measurementKind; this.type = type; this.units = units; this.maxReferenceRange = maxReferenceRange; @@ -86,6 +94,22 @@ public String getValue() { return value; } + /** + * @return ℹ️ This enum is non-exhaustive. + */ + @JsonProperty("sample_type") + public Optional getSampleType() { + return sampleType; + } + + /** + * @return ℹ️ This enum is non-exhaustive. + */ + @JsonProperty("measurement_kind") + public Optional getMeasurementKind() { + return measurementKind; + } + /** * @return ℹ️ This enum is non-exhaustive. */ @@ -232,6 +256,8 @@ public Map getAdditionalProperties() { private boolean equalTo(LabReportResult other) { return testName.equals(other.testName) && value.equals(other.value) + && sampleType.equals(other.sampleType) + && measurementKind.equals(other.measurementKind) && type.equals(other.type) && units.equals(other.units) && maxReferenceRange.equals(other.maxReferenceRange) @@ -248,6 +274,8 @@ public int hashCode() { return Objects.hash( this.testName, this.value, + this.sampleType, + this.measurementKind, this.type, this.units, this.maxReferenceRange, @@ -285,6 +313,20 @@ public interface _FinalStage { _FinalStage additionalProperties(Map additionalProperties); + /** + *

ℹ️ This enum is non-exhaustive.

+ */ + _FinalStage sampleType(Optional sampleType); + + _FinalStage sampleType(LabReportResultSampleType sampleType); + + /** + *

ℹ️ This enum is non-exhaustive.

+ */ + _FinalStage measurementKind(Optional measurementKind); + + _FinalStage measurementKind(LabReportResultMeasurementKind measurementKind); + /** *

ℹ️ This enum is non-exhaustive.

*/ @@ -370,6 +412,10 @@ public static final class Builder implements TestNameStage, ValueStage, _FinalSt private Optional type = Optional.empty(); + private Optional measurementKind = Optional.empty(); + + private Optional sampleType = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -379,6 +425,8 @@ private Builder() {} public Builder from(LabReportResult other) { testName(other.getTestName()); value(other.getValue()); + sampleType(other.getSampleType()); + measurementKind(other.getMeasurementKind()); type(other.getType()); units(other.getUnits()); maxReferenceRange(other.getMaxReferenceRange()); @@ -652,11 +700,53 @@ public _FinalStage type(Optional type) { return this; } + /** + *

ℹ️ This enum is non-exhaustive.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage measurementKind(LabReportResultMeasurementKind measurementKind) { + this.measurementKind = Optional.ofNullable(measurementKind); + return this; + } + + /** + *

ℹ️ This enum is non-exhaustive.

+ */ + @java.lang.Override + @JsonSetter(value = "measurement_kind", nulls = Nulls.SKIP) + public _FinalStage measurementKind(Optional measurementKind) { + this.measurementKind = measurementKind; + return this; + } + + /** + *

ℹ️ This enum is non-exhaustive.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage sampleType(LabReportResultSampleType sampleType) { + this.sampleType = Optional.ofNullable(sampleType); + return this; + } + + /** + *

ℹ️ This enum is non-exhaustive.

+ */ + @java.lang.Override + @JsonSetter(value = "sample_type", nulls = Nulls.SKIP) + public _FinalStage sampleType(Optional sampleType) { + this.sampleType = sampleType; + return this; + } + @java.lang.Override public LabReportResult build() { return new LabReportResult( testName, value, + sampleType, + measurementKind, type, units, maxReferenceRange, diff --git a/src/main/java/com/junction/api/types/LabReportResultMeasurementKind.java b/src/main/java/com/junction/api/types/LabReportResultMeasurementKind.java new file mode 100644 index 0000000..6971302 --- /dev/null +++ b/src/main/java/com/junction/api/types/LabReportResultMeasurementKind.java @@ -0,0 +1,107 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.junction.api.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class LabReportResultMeasurementKind { + public static final LabReportResultMeasurementKind RATIO = new LabReportResultMeasurementKind(Value.RATIO, "ratio"); + + public static final LabReportResultMeasurementKind UNKNOWN = + new LabReportResultMeasurementKind(Value.UNKNOWN, "unknown"); + + public static final LabReportResultMeasurementKind DIRECT = + new LabReportResultMeasurementKind(Value.DIRECT, "direct"); + + public static final LabReportResultMeasurementKind CALCULATED = + new LabReportResultMeasurementKind(Value.CALCULATED, "calculated"); + + private final Value value; + + private final String string; + + LabReportResultMeasurementKind(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof LabReportResultMeasurementKind + && this.string.equals(((LabReportResultMeasurementKind) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case RATIO: + return visitor.visitRatio(); + case UNKNOWN: + return visitor.visitUnknown(); + case DIRECT: + return visitor.visitDirect(); + case CALCULATED: + return visitor.visitCalculated(); + case _UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static LabReportResultMeasurementKind valueOf(String value) { + switch (value) { + case "ratio": + return RATIO; + case "unknown": + return UNKNOWN; + case "direct": + return DIRECT; + case "calculated": + return CALCULATED; + default: + return new LabReportResultMeasurementKind(Value._UNKNOWN, value); + } + } + + public enum Value { + DIRECT, + + CALCULATED, + + RATIO, + + UNKNOWN, + + _UNKNOWN + } + + public interface Visitor { + T visitDirect(); + + T visitCalculated(); + + T visitRatio(); + + T visitUnknown(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/junction/api/types/LabReportResultSampleType.java b/src/main/java/com/junction/api/types/LabReportResultSampleType.java new file mode 100644 index 0000000..96545d5 --- /dev/null +++ b/src/main/java/com/junction/api/types/LabReportResultSampleType.java @@ -0,0 +1,136 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.junction.api.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class LabReportResultSampleType { + public static final LabReportResultSampleType STOOL = new LabReportResultSampleType(Value.STOOL, "stool"); + + public static final LabReportResultSampleType OTHER = new LabReportResultSampleType(Value.OTHER, "other"); + + public static final LabReportResultSampleType URINE = new LabReportResultSampleType(Value.URINE, "urine"); + + public static final LabReportResultSampleType SERUM_PLASMA_BLOOD = + new LabReportResultSampleType(Value.SERUM_PLASMA_BLOOD, "serum_plasma_blood"); + + public static final LabReportResultSampleType CAPILLARY_BLOOD = + new LabReportResultSampleType(Value.CAPILLARY_BLOOD, "capillary_blood"); + + public static final LabReportResultSampleType UNKNOWN = new LabReportResultSampleType(Value.UNKNOWN, "unknown"); + + public static final LabReportResultSampleType SALIVA = new LabReportResultSampleType(Value.SALIVA, "saliva"); + + private final Value value; + + private final String string; + + LabReportResultSampleType(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof LabReportResultSampleType + && this.string.equals(((LabReportResultSampleType) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case STOOL: + return visitor.visitStool(); + case OTHER: + return visitor.visitOther(); + case URINE: + return visitor.visitUrine(); + case SERUM_PLASMA_BLOOD: + return visitor.visitSerumPlasmaBlood(); + case CAPILLARY_BLOOD: + return visitor.visitCapillaryBlood(); + case UNKNOWN: + return visitor.visitUnknown(); + case SALIVA: + return visitor.visitSaliva(); + case _UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static LabReportResultSampleType valueOf(String value) { + switch (value) { + case "stool": + return STOOL; + case "other": + return OTHER; + case "urine": + return URINE; + case "serum_plasma_blood": + return SERUM_PLASMA_BLOOD; + case "capillary_blood": + return CAPILLARY_BLOOD; + case "unknown": + return UNKNOWN; + case "saliva": + return SALIVA; + default: + return new LabReportResultSampleType(Value._UNKNOWN, value); + } + } + + public enum Value { + URINE, + + SERUM_PLASMA_BLOOD, + + CAPILLARY_BLOOD, + + STOOL, + + SALIVA, + + OTHER, + + UNKNOWN, + + _UNKNOWN + } + + public interface Visitor { + T visitUrine(); + + T visitSerumPlasmaBlood(); + + T visitCapillaryBlood(); + + T visitStool(); + + T visitSaliva(); + + T visitOther(); + + T visitUnknown(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/junction/api/types/MealInDbBaseClientFacingSource.java b/src/main/java/com/junction/api/types/MealInDbBaseClientFacingSource.java index 7d46cdd..25a5f1f 100644 --- a/src/main/java/com/junction/api/types/MealInDbBaseClientFacingSource.java +++ b/src/main/java/com/junction/api/types/MealInDbBaseClientFacingSource.java @@ -37,6 +37,8 @@ public final class MealInDbBaseClientFacingSource { private final OffsetDateTime timestamp; + private final String calendarDate; + private final String name; private final Optional energy; @@ -66,6 +68,7 @@ private MealInDbBaseClientFacingSource( int sourceId, String providerId, OffsetDateTime timestamp, + String calendarDate, String name, Optional energy, Optional macros, @@ -83,6 +86,7 @@ private MealInDbBaseClientFacingSource( this.sourceId = sourceId; this.providerId = providerId; this.timestamp = timestamp; + this.calendarDate = calendarDate; this.name = name; this.energy = energy; this.macros = macros; @@ -135,6 +139,14 @@ public OffsetDateTime getTimestamp() { return timestamp; } + /** + * @return Date of the meal in the YYYY-mm-dd format. For providers that only expose a date, this is the calendar date as recorded by the user. + */ + @JsonProperty("calendar_date") + public String getCalendarDate() { + return calendarDate; + } + @JsonProperty("name") public String getName() { return name; @@ -248,6 +260,7 @@ private boolean equalTo(MealInDbBaseClientFacingSource other) { && sourceId == other.sourceId && providerId.equals(other.providerId) && timestamp.equals(other.timestamp) + && calendarDate.equals(other.calendarDate) && name.equals(other.name) && energy.equals(other.energy) && macros.equals(other.macros) @@ -269,6 +282,7 @@ public int hashCode() { this.sourceId, this.providerId, this.timestamp, + this.calendarDate, this.name, this.energy, this.macros, @@ -322,7 +336,14 @@ public interface ProviderIdStage { } public interface TimestampStage { - NameStage timestamp(@NotNull OffsetDateTime timestamp); + CalendarDateStage timestamp(@NotNull OffsetDateTime timestamp); + } + + public interface CalendarDateStage { + /** + *

Date of the meal in the YYYY-mm-dd format. For providers that only expose a date, this is the calendar date as recorded by the user.

+ */ + NameStage calendarDate(@NotNull String calendarDate); } public interface NameStage { @@ -391,6 +412,7 @@ public static final class Builder SourceIdStage, ProviderIdStage, TimestampStage, + CalendarDateStage, NameStage, SourceStage, CreatedAtStage, @@ -408,6 +430,8 @@ public static final class Builder private OffsetDateTime timestamp; + private String calendarDate; + private String name; private ClientFacingSource source; @@ -441,6 +465,7 @@ public Builder from(MealInDbBaseClientFacingSource other) { sourceId(other.getSourceId()); providerId(other.getProviderId()); timestamp(other.getTimestamp()); + calendarDate(other.getCalendarDate()); name(other.getName()); energy(other.getEnergy()); macros(other.getMacros()); @@ -506,11 +531,23 @@ public TimestampStage providerId(@NotNull String providerId) { @java.lang.Override @JsonSetter("timestamp") - public NameStage timestamp(@NotNull OffsetDateTime timestamp) { + public CalendarDateStage timestamp(@NotNull OffsetDateTime timestamp) { this.timestamp = Objects.requireNonNull(timestamp, "timestamp must not be null"); return this; } + /** + *

Date of the meal in the YYYY-mm-dd format. For providers that only expose a date, this is the calendar date as recorded by the user.

+ *

Date of the meal in the YYYY-mm-dd format. For providers that only expose a date, this is the calendar date as recorded by the user.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("calendar_date") + public NameStage calendarDate(@NotNull String calendarDate) { + this.calendarDate = Objects.requireNonNull(calendarDate, "calendarDate must not be null"); + return this; + } + @java.lang.Override @JsonSetter("name") public SourceStage name(@NotNull String name) { @@ -686,6 +723,7 @@ public MealInDbBaseClientFacingSource build() { sourceId, providerId, timestamp, + calendarDate, name, energy, macros,