diff --git a/.fern/metadata.json b/.fern/metadata.json index 972db505..6a918934 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -8,5 +8,5 @@ "client-class-name": "Vital", "enable-forward-compatible-enums": false }, - "sdkVersion": "1.2.600" + "sdkVersion": "1.2.601" } \ No newline at end of file diff --git a/build.gradle b/build.gradle index 20c8f772..7d719024 100644 --- a/build.gradle +++ b/build.gradle @@ -47,7 +47,7 @@ java { group = 'io.tryvital' -version = '1.2.600' +version = '1.2.601' jar { dependsOn(":generatePomFileForMavenPublication") @@ -78,7 +78,7 @@ publishing { maven(MavenPublication) { groupId = 'io.tryvital' artifactId = 'vital-java' - version = '1.2.600' + version = '1.2.601' from components.java pom { name = 'vital' diff --git a/reference.md b/reference.md index 683b39da..bec83aea 100644 --- a/reference.md +++ b/reference.md @@ -12024,6 +12024,7 @@ client.labTests().getOrders( .userId("user_id") .patientName("patient_name") .shippingRecipientName("shipping_recipient_name") + .orderTransactionId("order_transaction_id") .page(1) .size(1) .build() @@ -12170,6 +12171,14 @@ client.labTests().getOrders(
+**orderTransactionId:** `Optional` — Filter by order transaction ID + +
+
+ +
+
+ **page:** `Optional`
@@ -13213,7 +13222,7 @@ client.labTests().getPscAppointmentAvailability(
-**allowStale:** `Optional` — [Closed Beta] Serve last known good information when the PSC system is temporarily unavailable. +**allowStale:** `Optional` — If true, allows cached availability data to be returned.
diff --git a/src/main/java/com/vital/api/core/ClientOptions.java b/src/main/java/com/vital/api/core/ClientOptions.java index 3f419f88..43c4b250 100644 --- a/src/main/java/com/vital/api/core/ClientOptions.java +++ b/src/main/java/com/vital/api/core/ClientOptions.java @@ -35,10 +35,10 @@ private ClientOptions( this.headers.putAll(headers); this.headers.putAll(new HashMap() { { - put("User-Agent", "io.tryvital:vital-java/1.2.600"); + put("User-Agent", "io.tryvital:vital-java/1.2.601"); put("X-Fern-Language", "JAVA"); put("X-Fern-SDK-Name", "com.vital.fern:api-sdk"); - put("X-Fern-SDK-Version", "1.2.600"); + put("X-Fern-SDK-Version", "1.2.601"); } }); this.headerSuppliers = headerSuppliers; diff --git a/src/main/java/com/vital/api/resources/labtests/AsyncRawLabTestsClient.java b/src/main/java/com/vital/api/resources/labtests/AsyncRawLabTestsClient.java index d9094e83..897e71b6 100644 --- a/src/main/java/com/vital/api/resources/labtests/AsyncRawLabTestsClient.java +++ b/src/main/java/com/vital/api/resources/labtests/AsyncRawLabTestsClient.java @@ -1168,6 +1168,13 @@ public CompletableFuture> getOrders( request.getShippingRecipientName().get(), false); } + if (request.getOrderTransactionId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "order_transaction_id", + request.getOrderTransactionId().get(), + false); + } if (request.getPage().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "page", request.getPage().get(), false); diff --git a/src/main/java/com/vital/api/resources/labtests/RawLabTestsClient.java b/src/main/java/com/vital/api/resources/labtests/RawLabTestsClient.java index 12cc6d3b..ce9792f0 100644 --- a/src/main/java/com/vital/api/resources/labtests/RawLabTestsClient.java +++ b/src/main/java/com/vital/api/resources/labtests/RawLabTestsClient.java @@ -983,6 +983,13 @@ public VitalHttpResponse getOrders( request.getShippingRecipientName().get(), false); } + if (request.getOrderTransactionId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "order_transaction_id", + request.getOrderTransactionId().get(), + false); + } if (request.getPage().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "page", request.getPage().get(), false); diff --git a/src/main/java/com/vital/api/resources/labtests/requests/LabTestsGetOrdersRequest.java b/src/main/java/com/vital/api/resources/labtests/requests/LabTestsGetOrdersRequest.java index b05aa64e..ce6918a6 100644 --- a/src/main/java/com/vital/api/resources/labtests/requests/LabTestsGetOrdersRequest.java +++ b/src/main/java/com/vital/api/resources/labtests/requests/LabTestsGetOrdersRequest.java @@ -61,6 +61,8 @@ public final class LabTestsGetOrdersRequest { private final Optional shippingRecipientName; + private final Optional orderTransactionId; + private final Optional page; private final Optional size; @@ -84,6 +86,7 @@ private LabTestsGetOrdersRequest( Optional userId, Optional patientName, Optional shippingRecipientName, + Optional orderTransactionId, Optional page, Optional size, Map additionalProperties) { @@ -103,6 +106,7 @@ private LabTestsGetOrdersRequest( this.userId = userId; this.patientName = patientName; this.shippingRecipientName = shippingRecipientName; + this.orderTransactionId = orderTransactionId; this.page = page; this.size = size; this.additionalProperties = additionalProperties; @@ -236,6 +240,14 @@ public Optional getShippingRecipientName() { return shippingRecipientName; } + /** + * @return Filter by order transaction ID + */ + @JsonProperty("order_transaction_id") + public Optional getOrderTransactionId() { + return orderTransactionId; + } + @JsonProperty("page") public Optional getPage() { return page; @@ -274,6 +286,7 @@ private boolean equalTo(LabTestsGetOrdersRequest other) { && userId.equals(other.userId) && patientName.equals(other.patientName) && shippingRecipientName.equals(other.shippingRecipientName) + && orderTransactionId.equals(other.orderTransactionId) && page.equals(other.page) && size.equals(other.size); } @@ -297,6 +310,7 @@ public int hashCode() { this.userId, this.patientName, this.shippingRecipientName, + this.orderTransactionId, this.page, this.size); } @@ -344,6 +358,8 @@ public static final class Builder { private Optional shippingRecipientName = Optional.empty(); + private Optional orderTransactionId = Optional.empty(); + private Optional page = Optional.empty(); private Optional size = Optional.empty(); @@ -370,6 +386,7 @@ public Builder from(LabTestsGetOrdersRequest other) { userId(other.getUserId()); patientName(other.getPatientName()); shippingRecipientName(other.getShippingRecipientName()); + orderTransactionId(other.getOrderTransactionId()); page(other.getPage()); size(other.getSize()); return this; @@ -619,6 +636,20 @@ public Builder shippingRecipientName(String shippingRecipientName) { return this; } + /** + *

Filter by order transaction ID

+ */ + @JsonSetter(value = "order_transaction_id", nulls = Nulls.SKIP) + public Builder orderTransactionId(Optional orderTransactionId) { + this.orderTransactionId = orderTransactionId; + return this; + } + + public Builder orderTransactionId(String orderTransactionId) { + this.orderTransactionId = Optional.ofNullable(orderTransactionId); + return this; + } + @JsonSetter(value = "page", nulls = Nulls.SKIP) public Builder page(Optional page) { this.page = page; @@ -659,6 +690,7 @@ public LabTestsGetOrdersRequest build() { userId, patientName, shippingRecipientName, + orderTransactionId, page, size, additionalProperties); diff --git a/src/main/java/com/vital/api/resources/labtests/requests/LabTestsGetPscAppointmentAvailabilityRequest.java b/src/main/java/com/vital/api/resources/labtests/requests/LabTestsGetPscAppointmentAvailabilityRequest.java index f70f9006..718dfd60 100644 --- a/src/main/java/com/vital/api/resources/labtests/requests/LabTestsGetPscAppointmentAvailabilityRequest.java +++ b/src/main/java/com/vital/api/resources/labtests/requests/LabTestsGetPscAppointmentAvailabilityRequest.java @@ -96,7 +96,7 @@ public Optional getRadius() { } /** - * @return [Closed Beta] Serve last known good information when the PSC system is temporarily unavailable. + * @return If true, allows cached availability data to be returned. */ @JsonProperty("allow_stale") public Optional getAllowStale() { @@ -181,7 +181,7 @@ public interface _FinalStage { _FinalStage radius(AllowedRadius radius); /** - *

[Closed Beta] Serve last known good information when the PSC system is temporarily unavailable.

+ *

If true, allows cached availability data to be returned.

*/ _FinalStage allowStale(Optional allowStale); @@ -231,7 +231,7 @@ public _FinalStage lab(@NotNull String lab) { } /** - *

[Closed Beta] Serve last known good information when the PSC system is temporarily unavailable.

+ *

If true, allows cached availability data to be returned.

* @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @@ -241,7 +241,7 @@ public _FinalStage allowStale(Boolean allowStale) { } /** - *

[Closed Beta] Serve last known good information when the PSC system is temporarily unavailable.

+ *

If true, allows cached availability data to be returned.

*/ @java.lang.Override @JsonSetter(value = "allow_stale", nulls = Nulls.SKIP) diff --git a/src/main/java/com/vital/api/types/AppointmentBookingRequest.java b/src/main/java/com/vital/api/types/AppointmentBookingRequest.java index c19974c5..ef9180c1 100644 --- a/src/main/java/com/vital/api/types/AppointmentBookingRequest.java +++ b/src/main/java/com/vital/api/types/AppointmentBookingRequest.java @@ -50,17 +50,7 @@ public String getBookingKey() { } /** - * @return [!] This feature (Async Confirmation) is under Closed Beta. - *

If true, when the PSC system fails to confirm the booking within sync_confirmation_timeout_millisecond, this API - * endpoint would respond with a pending appointment. The booking attempt will continue asynchronously in background, until either:

- *
    - *
  1. the appointment moves to the reserved or confirmed state because an acknowledgement from the PSC system has been received; OR
  2. - *
  3. the pending appointment moves to the cancelled state because the async_confirmation_timeout_millisecond timeout is reached.
  4. - *
- *

You will receive labtest.appointment.updated webhooks for all the relevant status changes (pending, confirmed, reserved - * and cancelled).

- *

If false (default), when the PSC system fails to confirm the booking, this API endpoint would respond with - * 500 Internal Server Error.

+ * @return If true, the endpoint attempts to confirm the booking within the sync_confirmation_timeout_millisecond window. If confirmation is not received in time, a pending appointment is returned and booking continues asynchronously. If false (default), the endpoint waits for confirmation or returns a 500 error on failure. */ @JsonProperty("async_confirmation") public Optional getAsyncConfirmation() { @@ -68,10 +58,7 @@ public Optional getAsyncConfirmation() { } /** - * @return This parameter only takes effect when async_confirmation is true; no-op otherwise. - *

The maximum amount of time which the Book Appointment endpoint would wait before it responds with a pending appointment. - * This timeout does not stop the booking attempt — it will continue asynchronously in background.

- *

Defaults to 2.5 seconds. Must be 1-10 seconds.

+ * @return Maximum time (in milliseconds) to wait for booking confirmation before returning a pending appointment. Only applies when async_confirmation is true. Defaults to 2500ms. Range: 1000-10000ms. */ @JsonProperty("sync_confirmation_timeout_millisecond") public Optional getSyncConfirmationTimeoutMillisecond() { @@ -79,10 +66,7 @@ public Optional getSyncConfirmationTimeoutMillisecond() { } /** - * @return This parameter only takes effect when async_confirmation is true; no-op otherwise. - *

The maximum amount of time which Junction would try to asynchronously book in the pending appointment. If this timeout is - * reached, the pending appointment would be cancelled.

- *

Defaults to 15 minutes. Must be 1-2880 minutes.

+ * @return Maximum time (in milliseconds) to attempt asynchronous booking before cancelling the pending appointment. Only applies when async_confirmation is true. Defaults to 15 minutes. Range: 60000-172800000ms. */ @JsonProperty("async_confirmation_timeout_millisecond") public Optional getAsyncConfirmationTimeoutMillisecond() { @@ -135,37 +119,21 @@ public interface _FinalStage { AppointmentBookingRequest build(); /** - *

[!] This feature (Async Confirmation) is under Closed Beta.

- *

If true, when the PSC system fails to confirm the booking within sync_confirmation_timeout_millisecond, this API - * endpoint would respond with a pending appointment. The booking attempt will continue asynchronously in background, until either:

- *
    - *
  1. the appointment moves to the reserved or confirmed state because an acknowledgement from the PSC system has been received; OR
  2. - *
  3. the pending appointment moves to the cancelled state because the async_confirmation_timeout_millisecond timeout is reached.
  4. - *
- *

You will receive labtest.appointment.updated webhooks for all the relevant status changes (pending, confirmed, reserved - * and cancelled).

- *

If false (default), when the PSC system fails to confirm the booking, this API endpoint would respond with - * 500 Internal Server Error.

+ *

If true, the endpoint attempts to confirm the booking within the sync_confirmation_timeout_millisecond window. If confirmation is not received in time, a pending appointment is returned and booking continues asynchronously. If false (default), the endpoint waits for confirmation or returns a 500 error on failure.

*/ _FinalStage asyncConfirmation(Optional asyncConfirmation); _FinalStage asyncConfirmation(Boolean asyncConfirmation); /** - *

This parameter only takes effect when async_confirmation is true; no-op otherwise.

- *

The maximum amount of time which the Book Appointment endpoint would wait before it responds with a pending appointment. - * This timeout does not stop the booking attempt — it will continue asynchronously in background.

- *

Defaults to 2.5 seconds. Must be 1-10 seconds.

+ *

Maximum time (in milliseconds) to wait for booking confirmation before returning a pending appointment. Only applies when async_confirmation is true. Defaults to 2500ms. Range: 1000-10000ms.

*/ _FinalStage syncConfirmationTimeoutMillisecond(Optional syncConfirmationTimeoutMillisecond); _FinalStage syncConfirmationTimeoutMillisecond(Integer syncConfirmationTimeoutMillisecond); /** - *

This parameter only takes effect when async_confirmation is true; no-op otherwise.

- *

The maximum amount of time which Junction would try to asynchronously book in the pending appointment. If this timeout is - * reached, the pending appointment would be cancelled.

- *

Defaults to 15 minutes. Must be 1-2880 minutes.

+ *

Maximum time (in milliseconds) to attempt asynchronous booking before cancelling the pending appointment. Only applies when async_confirmation is true. Defaults to 15 minutes. Range: 60000-172800000ms.

*/ _FinalStage asyncConfirmationTimeoutMillisecond(Optional asyncConfirmationTimeoutMillisecond); @@ -204,10 +172,7 @@ public _FinalStage bookingKey(@NotNull String bookingKey) { } /** - *

This parameter only takes effect when async_confirmation is true; no-op otherwise.

- *

The maximum amount of time which Junction would try to asynchronously book in the pending appointment. If this timeout is - * reached, the pending appointment would be cancelled.

- *

Defaults to 15 minutes. Must be 1-2880 minutes.

+ *

Maximum time (in milliseconds) to attempt asynchronous booking before cancelling the pending appointment. Only applies when async_confirmation is true. Defaults to 15 minutes. Range: 60000-172800000ms.

* @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @@ -217,10 +182,7 @@ public _FinalStage asyncConfirmationTimeoutMillisecond(Integer asyncConfirmation } /** - *

This parameter only takes effect when async_confirmation is true; no-op otherwise.

- *

The maximum amount of time which Junction would try to asynchronously book in the pending appointment. If this timeout is - * reached, the pending appointment would be cancelled.

- *

Defaults to 15 minutes. Must be 1-2880 minutes.

+ *

Maximum time (in milliseconds) to attempt asynchronous booking before cancelling the pending appointment. Only applies when async_confirmation is true. Defaults to 15 minutes. Range: 60000-172800000ms.

*/ @java.lang.Override @JsonSetter(value = "async_confirmation_timeout_millisecond", nulls = Nulls.SKIP) @@ -230,10 +192,7 @@ public _FinalStage asyncConfirmationTimeoutMillisecond(Optional asyncCo } /** - *

This parameter only takes effect when async_confirmation is true; no-op otherwise.

- *

The maximum amount of time which the Book Appointment endpoint would wait before it responds with a pending appointment. - * This timeout does not stop the booking attempt — it will continue asynchronously in background.

- *

Defaults to 2.5 seconds. Must be 1-10 seconds.

+ *

Maximum time (in milliseconds) to wait for booking confirmation before returning a pending appointment. Only applies when async_confirmation is true. Defaults to 2500ms. Range: 1000-10000ms.

* @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @@ -243,10 +202,7 @@ public _FinalStage syncConfirmationTimeoutMillisecond(Integer syncConfirmationTi } /** - *

This parameter only takes effect when async_confirmation is true; no-op otherwise.

- *

The maximum amount of time which the Book Appointment endpoint would wait before it responds with a pending appointment. - * This timeout does not stop the booking attempt — it will continue asynchronously in background.

- *

Defaults to 2.5 seconds. Must be 1-10 seconds.

+ *

Maximum time (in milliseconds) to wait for booking confirmation before returning a pending appointment. Only applies when async_confirmation is true. Defaults to 2500ms. Range: 1000-10000ms.

*/ @java.lang.Override @JsonSetter(value = "sync_confirmation_timeout_millisecond", nulls = Nulls.SKIP) @@ -256,17 +212,7 @@ public _FinalStage syncConfirmationTimeoutMillisecond(Optional syncConf } /** - *

[!] This feature (Async Confirmation) is under Closed Beta.

- *

If true, when the PSC system fails to confirm the booking within sync_confirmation_timeout_millisecond, this API - * endpoint would respond with a pending appointment. The booking attempt will continue asynchronously in background, until either:

- *
    - *
  1. the appointment moves to the reserved or confirmed state because an acknowledgement from the PSC system has been received; OR
  2. - *
  3. the pending appointment moves to the cancelled state because the async_confirmation_timeout_millisecond timeout is reached.
  4. - *
- *

You will receive labtest.appointment.updated webhooks for all the relevant status changes (pending, confirmed, reserved - * and cancelled).

- *

If false (default), when the PSC system fails to confirm the booking, this API endpoint would respond with - * 500 Internal Server Error.

+ *

If true, the endpoint attempts to confirm the booking within the sync_confirmation_timeout_millisecond window. If confirmation is not received in time, a pending appointment is returned and booking continues asynchronously. If false (default), the endpoint waits for confirmation or returns a 500 error on failure.

* @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @@ -276,17 +222,7 @@ public _FinalStage asyncConfirmation(Boolean asyncConfirmation) { } /** - *

[!] This feature (Async Confirmation) is under Closed Beta.

- *

If true, when the PSC system fails to confirm the booking within sync_confirmation_timeout_millisecond, this API - * endpoint would respond with a pending appointment. The booking attempt will continue asynchronously in background, until either:

- *
    - *
  1. the appointment moves to the reserved or confirmed state because an acknowledgement from the PSC system has been received; OR
  2. - *
  3. the pending appointment moves to the cancelled state because the async_confirmation_timeout_millisecond timeout is reached.
  4. - *
- *

You will receive labtest.appointment.updated webhooks for all the relevant status changes (pending, confirmed, reserved - * and cancelled).

- *

If false (default), when the PSC system fails to confirm the booking, this API endpoint would respond with - * 500 Internal Server Error.

+ *

If true, the endpoint attempts to confirm the booking within the sync_confirmation_timeout_millisecond window. If confirmation is not received in time, a pending appointment is returned and booking continues asynchronously. If false (default), the endpoint waits for confirmation or returns a 500 error on failure.

*/ @java.lang.Override @JsonSetter(value = "async_confirmation", nulls = Nulls.SKIP) diff --git a/src/main/java/com/vital/api/types/ClientFacingAppointment.java b/src/main/java/com/vital/api/types/ClientFacingAppointment.java index 9e2139b7..9b754232 100644 --- a/src/main/java/com/vital/api/types/ClientFacingAppointment.java +++ b/src/main/java/com/vital/api/types/ClientFacingAppointment.java @@ -30,6 +30,8 @@ public final class ClientFacingAppointment { private final String orderId; + private final Optional orderTransactionId; + private final UsAddress address; private final LngLat location; @@ -64,6 +66,7 @@ private ClientFacingAppointment( String id, String userId, String orderId, + Optional orderTransactionId, UsAddress address, LngLat location, Optional startAt, @@ -82,6 +85,7 @@ private ClientFacingAppointment( this.id = id; this.userId = userId; this.orderId = orderId; + this.orderTransactionId = orderTransactionId; this.address = address; this.location = location; this.startAt = startAt; @@ -114,6 +118,11 @@ public String getOrderId() { return orderId; } + @JsonProperty("order_transaction_id") + public Optional getOrderTransactionId() { + return orderTransactionId; + } + @JsonProperty("address") public UsAddress getAddress() { return address; @@ -205,6 +214,7 @@ private boolean equalTo(ClientFacingAppointment other) { return id.equals(other.id) && userId.equals(other.userId) && orderId.equals(other.orderId) + && orderTransactionId.equals(other.orderTransactionId) && address.equals(other.address) && location.equals(other.location) && startAt.equals(other.startAt) @@ -227,6 +237,7 @@ public int hashCode() { this.id, this.userId, this.orderId, + this.orderTransactionId, this.address, this.location, this.startAt, @@ -301,6 +312,10 @@ public interface EventStatusStage { public interface _FinalStage { ClientFacingAppointment build(); + _FinalStage orderTransactionId(Optional orderTransactionId); + + _FinalStage orderTransactionId(String orderTransactionId); + /** *

Time is in UTC

*/ @@ -382,6 +397,8 @@ public static final class Builder private Optional startAt = Optional.empty(); + private Optional orderTransactionId = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -392,6 +409,7 @@ public Builder from(ClientFacingAppointment other) { id(other.getId()); userId(other.getUserId()); orderId(other.getOrderId()); + orderTransactionId(other.getOrderTransactionId()); address(other.getAddress()); location(other.getLocation()); startAt(other.getStartAt()); @@ -589,12 +607,26 @@ public _FinalStage startAt(Optional startAt) { return this; } + @java.lang.Override + public _FinalStage orderTransactionId(String orderTransactionId) { + this.orderTransactionId = Optional.ofNullable(orderTransactionId); + return this; + } + + @java.lang.Override + @JsonSetter(value = "order_transaction_id", nulls = Nulls.SKIP) + public _FinalStage orderTransactionId(Optional orderTransactionId) { + this.orderTransactionId = orderTransactionId; + return this; + } + @java.lang.Override public ClientFacingAppointment build() { return new ClientFacingAppointment( id, userId, orderId, + orderTransactionId, address, location, startAt, diff --git a/src/main/java/com/vital/api/types/ClientFacingOrder.java b/src/main/java/com/vital/api/types/ClientFacingOrder.java index c73ebd28..a50ade83 100644 --- a/src/main/java/com/vital/api/types/ClientFacingOrder.java +++ b/src/main/java/com/vital/api/types/ClientFacingOrder.java @@ -78,6 +78,12 @@ public final class ClientFacingOrder { private final Optional worstCaseResultByDate; + private final Optional origin; + + private final Optional parentId; + + private final Optional orderTransaction; + private final Map additionalProperties; private ClientFacingOrder( @@ -108,6 +114,9 @@ private ClientFacingOrder( Optional hasMissingResults, Optional expectedResultByDate, Optional worstCaseResultByDate, + Optional origin, + Optional parentId, + Optional orderTransaction, Map additionalProperties) { this.userId = userId; this.id = id; @@ -136,6 +145,9 @@ private ClientFacingOrder( this.hasMissingResults = hasMissingResults; this.expectedResultByDate = expectedResultByDate; this.worstCaseResultByDate = worstCaseResultByDate; + this.origin = origin; + this.parentId = parentId; + this.orderTransaction = orderTransaction; this.additionalProperties = additionalProperties; } @@ -334,6 +346,21 @@ public Optional getWorstCaseResultByDate() { return worstCaseResultByDate; } + @JsonProperty("origin") + public Optional getOrigin() { + return origin; + } + + @JsonProperty("parent_id") + public Optional getParentId() { + return parentId; + } + + @JsonProperty("order_transaction") + public Optional getOrderTransaction() { + return orderTransaction; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -372,7 +399,10 @@ private boolean equalTo(ClientFacingOrder other) { && interpretation.equals(other.interpretation) && hasMissingResults.equals(other.hasMissingResults) && expectedResultByDate.equals(other.expectedResultByDate) - && worstCaseResultByDate.equals(other.worstCaseResultByDate); + && worstCaseResultByDate.equals(other.worstCaseResultByDate) + && origin.equals(other.origin) + && parentId.equals(other.parentId) + && orderTransaction.equals(other.orderTransaction); } @java.lang.Override @@ -404,7 +434,10 @@ public int hashCode() { this.interpretation, this.hasMissingResults, this.expectedResultByDate, - this.worstCaseResultByDate); + this.worstCaseResultByDate, + this.origin, + this.parentId, + this.orderTransaction); } @java.lang.Override @@ -590,6 +623,18 @@ public interface _FinalStage { _FinalStage worstCaseResultByDate(Optional worstCaseResultByDate); _FinalStage worstCaseResultByDate(String worstCaseResultByDate); + + _FinalStage origin(Optional origin); + + _FinalStage origin(OrderOrigin origin); + + _FinalStage parentId(Optional parentId); + + _FinalStage parentId(String parentId); + + _FinalStage orderTransaction(Optional orderTransaction); + + _FinalStage orderTransaction(ClientFacingOrderTransaction orderTransaction); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -619,6 +664,12 @@ public static final class Builder private boolean hasAbn; + private Optional orderTransaction = Optional.empty(); + + private Optional parentId = Optional.empty(); + + private Optional origin = Optional.empty(); + private Optional worstCaseResultByDate = Optional.empty(); private Optional expectedResultByDate = Optional.empty(); @@ -691,6 +742,9 @@ public Builder from(ClientFacingOrder other) { hasMissingResults(other.getHasMissingResults()); expectedResultByDate(other.getExpectedResultByDate()); worstCaseResultByDate(other.getWorstCaseResultByDate()); + origin(other.getOrigin()); + parentId(other.getParentId()); + orderTransaction(other.getOrderTransaction()); return this; } @@ -785,6 +839,45 @@ public _FinalStage hasAbn(boolean hasAbn) { return this; } + @java.lang.Override + public _FinalStage orderTransaction(ClientFacingOrderTransaction orderTransaction) { + this.orderTransaction = Optional.ofNullable(orderTransaction); + return this; + } + + @java.lang.Override + @JsonSetter(value = "order_transaction", nulls = Nulls.SKIP) + public _FinalStage orderTransaction(Optional orderTransaction) { + this.orderTransaction = orderTransaction; + return this; + } + + @java.lang.Override + public _FinalStage parentId(String parentId) { + this.parentId = Optional.ofNullable(parentId); + return this; + } + + @java.lang.Override + @JsonSetter(value = "parent_id", nulls = Nulls.SKIP) + public _FinalStage parentId(Optional parentId) { + this.parentId = parentId; + return this; + } + + @java.lang.Override + public _FinalStage origin(OrderOrigin origin) { + this.origin = Optional.ofNullable(origin); + return this; + } + + @java.lang.Override + @JsonSetter(value = "origin", nulls = Nulls.SKIP) + public _FinalStage origin(Optional origin) { + this.origin = origin; + return this; + } + /** *

The latest date by which the order result is expected to be available.

* @return Reference to {@code this} so that method calls can be chained together. @@ -1164,6 +1257,9 @@ public ClientFacingOrder build() { hasMissingResults, expectedResultByDate, worstCaseResultByDate, + origin, + parentId, + orderTransaction, additionalProperties); } } diff --git a/src/main/java/com/vital/api/types/ClientFacingOrderInTransaction.java b/src/main/java/com/vital/api/types/ClientFacingOrderInTransaction.java new file mode 100644 index 00000000..4585d6c8 --- /dev/null +++ b/src/main/java/com/vital/api/types/ClientFacingOrderInTransaction.java @@ -0,0 +1,277 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vital.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.vital.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ClientFacingOrderInTransaction.Builder.class) +public final class ClientFacingOrderInTransaction { + private final String id; + + private final Optional status; + + private final Optional statusCreatedAt; + + private final Optional origin; + + private final Optional parentId; + + private final OffsetDateTime createdAt; + + private final OffsetDateTime updatedAt; + + private final Map additionalProperties; + + private ClientFacingOrderInTransaction( + String id, + Optional status, + Optional statusCreatedAt, + Optional origin, + Optional parentId, + OffsetDateTime createdAt, + OffsetDateTime updatedAt, + Map additionalProperties) { + this.id = id; + this.status = status; + this.statusCreatedAt = statusCreatedAt; + this.origin = origin; + this.parentId = parentId; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + @JsonProperty("status_created_at") + public Optional getStatusCreatedAt() { + return statusCreatedAt; + } + + @JsonProperty("origin") + public Optional getOrigin() { + return origin; + } + + @JsonProperty("parent_id") + public Optional getParentId() { + return parentId; + } + + @JsonProperty("created_at") + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + @JsonProperty("updated_at") + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ClientFacingOrderInTransaction && equalTo((ClientFacingOrderInTransaction) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ClientFacingOrderInTransaction other) { + return id.equals(other.id) + && status.equals(other.status) + && statusCreatedAt.equals(other.statusCreatedAt) + && origin.equals(other.origin) + && parentId.equals(other.parentId) + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, this.status, this.statusCreatedAt, this.origin, this.parentId, this.createdAt, this.updatedAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + CreatedAtStage id(@NotNull String id); + + Builder from(ClientFacingOrderInTransaction other); + } + + public interface CreatedAtStage { + UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt); + } + + public interface UpdatedAtStage { + _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt); + } + + public interface _FinalStage { + ClientFacingOrderInTransaction build(); + + _FinalStage status(Optional status); + + _FinalStage status(OrderTopLevelStatus status); + + _FinalStage statusCreatedAt(Optional statusCreatedAt); + + _FinalStage statusCreatedAt(OffsetDateTime statusCreatedAt); + + _FinalStage origin(Optional origin); + + _FinalStage origin(OrderOrigin origin); + + _FinalStage parentId(Optional parentId); + + _FinalStage parentId(String parentId); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, CreatedAtStage, UpdatedAtStage, _FinalStage { + private String id; + + private OffsetDateTime createdAt; + + private OffsetDateTime updatedAt; + + private Optional parentId = Optional.empty(); + + private Optional origin = Optional.empty(); + + private Optional statusCreatedAt = Optional.empty(); + + private Optional status = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ClientFacingOrderInTransaction other) { + id(other.getId()); + status(other.getStatus()); + statusCreatedAt(other.getStatusCreatedAt()); + origin(other.getOrigin()); + parentId(other.getParentId()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public CreatedAtStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("created_at") + public UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt) { + this.createdAt = Objects.requireNonNull(createdAt, "createdAt must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("updated_at") + public _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt) { + this.updatedAt = Objects.requireNonNull(updatedAt, "updatedAt must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage parentId(String parentId) { + this.parentId = Optional.ofNullable(parentId); + return this; + } + + @java.lang.Override + @JsonSetter(value = "parent_id", nulls = Nulls.SKIP) + public _FinalStage parentId(Optional parentId) { + this.parentId = parentId; + return this; + } + + @java.lang.Override + public _FinalStage origin(OrderOrigin origin) { + this.origin = Optional.ofNullable(origin); + return this; + } + + @java.lang.Override + @JsonSetter(value = "origin", nulls = Nulls.SKIP) + public _FinalStage origin(Optional origin) { + this.origin = origin; + return this; + } + + @java.lang.Override + public _FinalStage statusCreatedAt(OffsetDateTime statusCreatedAt) { + this.statusCreatedAt = Optional.ofNullable(statusCreatedAt); + return this; + } + + @java.lang.Override + @JsonSetter(value = "status_created_at", nulls = Nulls.SKIP) + public _FinalStage statusCreatedAt(Optional statusCreatedAt) { + this.statusCreatedAt = statusCreatedAt; + return this; + } + + @java.lang.Override + public _FinalStage status(OrderTopLevelStatus status) { + this.status = Optional.ofNullable(status); + return this; + } + + @java.lang.Override + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public _FinalStage status(Optional status) { + this.status = status; + return this; + } + + @java.lang.Override + public ClientFacingOrderInTransaction build() { + return new ClientFacingOrderInTransaction( + id, status, statusCreatedAt, origin, parentId, createdAt, updatedAt, additionalProperties); + } + } +} diff --git a/src/main/java/com/vital/api/types/ClientFacingOrderTransaction.java b/src/main/java/com/vital/api/types/ClientFacingOrderTransaction.java new file mode 100644 index 00000000..0852a30e --- /dev/null +++ b/src/main/java/com/vital/api/types/ClientFacingOrderTransaction.java @@ -0,0 +1,172 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vital.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.vital.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ClientFacingOrderTransaction.Builder.class) +public final class ClientFacingOrderTransaction { + private final String id; + + private final OrderTransactionStatus status; + + private final List orders; + + private final Map additionalProperties; + + private ClientFacingOrderTransaction( + String id, + OrderTransactionStatus status, + List orders, + Map additionalProperties) { + this.id = id; + this.status = status; + this.orders = orders; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("status") + public OrderTransactionStatus getStatus() { + return status; + } + + @JsonProperty("orders") + public List getOrders() { + return orders; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ClientFacingOrderTransaction && equalTo((ClientFacingOrderTransaction) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ClientFacingOrderTransaction other) { + return id.equals(other.id) && status.equals(other.status) && orders.equals(other.orders); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.status, this.orders); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + StatusStage id(@NotNull String id); + + Builder from(ClientFacingOrderTransaction other); + } + + public interface StatusStage { + _FinalStage status(@NotNull OrderTransactionStatus status); + } + + public interface _FinalStage { + ClientFacingOrderTransaction build(); + + _FinalStage orders(List orders); + + _FinalStage addOrders(ClientFacingOrderInTransaction orders); + + _FinalStage addAllOrders(List orders); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, StatusStage, _FinalStage { + private String id; + + private OrderTransactionStatus status; + + private List orders = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ClientFacingOrderTransaction other) { + id(other.getId()); + status(other.getStatus()); + orders(other.getOrders()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public StatusStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("status") + public _FinalStage status(@NotNull OrderTransactionStatus status) { + this.status = Objects.requireNonNull(status, "status must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage addAllOrders(List orders) { + if (orders != null) { + this.orders.addAll(orders); + } + return this; + } + + @java.lang.Override + public _FinalStage addOrders(ClientFacingOrderInTransaction orders) { + this.orders.add(orders); + return this; + } + + @java.lang.Override + @JsonSetter(value = "orders", nulls = Nulls.SKIP) + public _FinalStage orders(List orders) { + this.orders.clear(); + if (orders != null) { + this.orders.addAll(orders); + } + return this; + } + + @java.lang.Override + public ClientFacingOrderTransaction build() { + return new ClientFacingOrderTransaction(id, status, orders, additionalProperties); + } + } +} diff --git a/src/main/java/com/vital/api/types/OrderOrigin.java b/src/main/java/com/vital/api/types/OrderOrigin.java new file mode 100644 index 00000000..8536ea27 --- /dev/null +++ b/src/main/java/com/vital/api/types/OrderOrigin.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vital.api.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum OrderOrigin { + INITIAL("initial"), + + REDRAW("redraw"), + + RECREATION("recreation"); + + private final String value; + + OrderOrigin(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/vital/api/types/OrderTransactionStatus.java b/src/main/java/com/vital/api/types/OrderTransactionStatus.java new file mode 100644 index 00000000..0f90c3f5 --- /dev/null +++ b/src/main/java/com/vital/api/types/OrderTransactionStatus.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.vital.api.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum OrderTransactionStatus { + ACTIVE("active"), + + COMPLETED("completed"), + + CANCELLED("cancelled"); + + private final String value; + + OrderTransactionStatus(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +}