* | :heavy_minus_sign: | The ID of the merchant account to use for this request. | |
+
+### Response
+
+**[ListTransactionActionsResponse](../../models/operations/ListTransactionActionsResponse.md)**
+
+### Errors
+
+| Error Type | Status Code | Content Type |
+| --------------------------------- | --------------------------------- | --------------------------------- |
+| models/errors/Error400 | 400 | application/json |
+| models/errors/Error401 | 401 | application/json |
+| models/errors/Error403 | 403 | application/json |
+| models/errors/Error404 | 404 | application/json |
+| models/errors/Error405 | 405 | application/json |
+| models/errors/Error409 | 409 | application/json |
+| models/errors/HTTPValidationError | 422 | application/json |
+| models/errors/Error425 | 425 | application/json |
+| models/errors/Error429 | 429 | application/json |
+| models/errors/Error500 | 500 | application/json |
+| models/errors/Error502 | 502 | application/json |
+| models/errors/Error504 | 504 | application/json |
+| models/errors/APIException | 4XX, 5XX | \*/\* |
\ No newline at end of file
diff --git a/gradle.properties b/gradle.properties
index 9e174a77..e021cdca 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -1,4 +1,4 @@
groupId=com.gr4vy
artifactId=sdk
-version=2.16.6
+version=2.16.7
org.gradle.jvmargs=-Xmx4g -XX:MaxMetaspaceSize=1g
diff --git a/src/main/java/com/gr4vy/sdk/Actions.java b/src/main/java/com/gr4vy/sdk/Actions.java
new file mode 100644
index 00000000..2fcf5226
--- /dev/null
+++ b/src/main/java/com/gr4vy/sdk/Actions.java
@@ -0,0 +1,87 @@
+/*
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
+ */
+package com.gr4vy.sdk;
+
+import static com.gr4vy.sdk.operations.Operations.RequestOperation;
+
+import com.gr4vy.sdk.models.operations.ListTransactionActionsRequest;
+import com.gr4vy.sdk.models.operations.ListTransactionActionsRequestBuilder;
+import com.gr4vy.sdk.models.operations.ListTransactionActionsResponse;
+import com.gr4vy.sdk.operations.ListTransactionActions;
+import com.gr4vy.sdk.utils.Headers;
+import com.gr4vy.sdk.utils.Options;
+import java.lang.String;
+import java.util.Optional;
+import org.openapitools.jackson.nullable.JsonNullable;
+
+
+public class Actions {
+ private static final Headers _headers = Headers.EMPTY;
+ private final SDKConfiguration sdkConfiguration;
+ private final AsyncActions asyncSDK;
+
+ Actions(SDKConfiguration sdkConfiguration) {
+ this.sdkConfiguration = sdkConfiguration;
+ this.asyncSDK = new AsyncActions(this, sdkConfiguration);
+ }
+
+ /**
+ * Switches to the async SDK.
+ *
+ * @return The async SDK
+ */
+ public AsyncActions async() {
+ return asyncSDK;
+ }
+
+ /**
+ * Get Flow actions for transaction
+ *
+ * Retrieve the list of Flow actions that have been triggered for a transaction.
+ *
+ * @return The call builder
+ */
+ public ListTransactionActionsRequestBuilder list() {
+ return new ListTransactionActionsRequestBuilder(sdkConfiguration);
+ }
+
+ /**
+ * Get Flow actions for transaction
+ *
+ *
Retrieve the list of Flow actions that have been triggered for a transaction.
+ *
+ * @param transactionId The ID of the transaction
+ * @return The response from the API call
+ * @throws RuntimeException subclass if the API call fails
+ */
+ public ListTransactionActionsResponse list(String transactionId) {
+ return list(transactionId, JsonNullable.undefined(), Optional.empty());
+ }
+
+ /**
+ * Get Flow actions for transaction
+ *
+ *
Retrieve the list of Flow actions that have been triggered for a transaction.
+ *
+ * @param transactionId The ID of the transaction
+ * @param merchantAccountId
+ * @param options additional options
+ * @return The response from the API call
+ * @throws RuntimeException subclass if the API call fails
+ */
+ public ListTransactionActionsResponse list(
+ String transactionId, JsonNullable merchantAccountId,
+ Optional options) {
+ ListTransactionActionsRequest request =
+ ListTransactionActionsRequest
+ .builder()
+ .transactionId(transactionId)
+ .merchantAccountId(merchantAccountId)
+ .build();
+ RequestOperation operation
+ = new ListTransactionActions.Sync(sdkConfiguration, options, _headers);
+ return operation.handleResponse(operation.doRequest(request));
+ }
+
+}
diff --git a/src/main/java/com/gr4vy/sdk/AsyncActions.java b/src/main/java/com/gr4vy/sdk/AsyncActions.java
new file mode 100644
index 00000000..fbb34e6a
--- /dev/null
+++ b/src/main/java/com/gr4vy/sdk/AsyncActions.java
@@ -0,0 +1,90 @@
+/*
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
+ */
+package com.gr4vy.sdk;
+
+import static com.gr4vy.sdk.operations.Operations.AsyncRequestOperation;
+
+import com.gr4vy.sdk.models.operations.ListTransactionActionsRequest;
+import com.gr4vy.sdk.models.operations.async.ListTransactionActionsRequestBuilder;
+import com.gr4vy.sdk.models.operations.async.ListTransactionActionsResponse;
+import com.gr4vy.sdk.operations.ListTransactionActions;
+import com.gr4vy.sdk.utils.Headers;
+import com.gr4vy.sdk.utils.Options;
+import java.lang.String;
+import java.util.Optional;
+import java.util.concurrent.CompletableFuture;
+import org.openapitools.jackson.nullable.JsonNullable;
+
+
+public class AsyncActions {
+ private static final Headers _headers = Headers.EMPTY;
+ private final SDKConfiguration sdkConfiguration;
+ private final Actions syncSDK;
+
+ AsyncActions(Actions syncSDK, SDKConfiguration sdkConfiguration) {
+ this.sdkConfiguration = sdkConfiguration;
+ this.syncSDK = syncSDK;
+ }
+
+ /**
+ * Switches to the sync SDK.
+ *
+ * @return The sync SDK
+ */
+ public Actions sync() {
+ return syncSDK;
+ }
+
+
+ /**
+ * Get Flow actions for transaction
+ *
+ * Retrieve the list of Flow actions that have been triggered for a transaction.
+ *
+ * @return The async call builder
+ */
+ public ListTransactionActionsRequestBuilder list() {
+ return new ListTransactionActionsRequestBuilder(sdkConfiguration);
+ }
+
+ /**
+ * Get Flow actions for transaction
+ *
+ *
Retrieve the list of Flow actions that have been triggered for a transaction.
+ *
+ * @param transactionId The ID of the transaction
+ * @return {@code CompletableFuture} - The async response
+ */
+ public CompletableFuture list(String transactionId) {
+ return list(transactionId, JsonNullable.undefined(), Optional.empty());
+ }
+
+ /**
+ * Get Flow actions for transaction
+ *
+ * Retrieve the list of Flow actions that have been triggered for a transaction.
+ *
+ * @param transactionId The ID of the transaction
+ * @param merchantAccountId
+ * @param options additional options
+ * @return {@code CompletableFuture} - The async response
+ */
+ public CompletableFuture list(
+ String transactionId, JsonNullable merchantAccountId,
+ Optional options) {
+ ListTransactionActionsRequest request =
+ ListTransactionActionsRequest
+ .builder()
+ .transactionId(transactionId)
+ .merchantAccountId(merchantAccountId)
+ .build();
+ AsyncRequestOperation operation
+ = new ListTransactionActions.Async(
+ sdkConfiguration, options, sdkConfiguration.retryScheduler(),
+ _headers);
+ return operation.doRequest(request)
+ .thenCompose(operation::handleResponse);
+ }
+
+}
diff --git a/src/main/java/com/gr4vy/sdk/AsyncTransactions.java b/src/main/java/com/gr4vy/sdk/AsyncTransactions.java
index 459c9a77..358bbf8b 100644
--- a/src/main/java/com/gr4vy/sdk/AsyncTransactions.java
+++ b/src/main/java/com/gr4vy/sdk/AsyncTransactions.java
@@ -53,6 +53,7 @@ public class AsyncTransactions {
private static final Headers _headers = Headers.EMPTY;
private final SDKConfiguration sdkConfiguration;
private final AsyncTransactionsRefunds refunds;
+ private final AsyncActions actions;
private final AsyncEvents events;
private final AsyncSettlements settlements;
private final Transactions syncSDK;
@@ -60,6 +61,7 @@ public class AsyncTransactions {
AsyncTransactions(Transactions syncSDK, SDKConfiguration sdkConfiguration) {
this.sdkConfiguration = sdkConfiguration;
this.refunds = new AsyncTransactionsRefunds(syncSDK.refunds(), this.sdkConfiguration);
+ this.actions = new AsyncActions(syncSDK.actions(), this.sdkConfiguration);
this.events = new AsyncEvents(syncSDK.events(), this.sdkConfiguration);
this.settlements = new AsyncSettlements(syncSDK.settlements(), this.sdkConfiguration);
this.syncSDK = syncSDK;
@@ -69,6 +71,10 @@ public final AsyncTransactionsRefunds refunds() {
return refunds;
}
+ public final AsyncActions actions() {
+ return actions;
+ }
+
public final AsyncEvents events() {
return events;
}
diff --git a/src/main/java/com/gr4vy/sdk/SDKConfiguration.java b/src/main/java/com/gr4vy/sdk/SDKConfiguration.java
index 6f2454db..cf77c295 100644
--- a/src/main/java/com/gr4vy/sdk/SDKConfiguration.java
+++ b/src/main/java/com/gr4vy/sdk/SDKConfiguration.java
@@ -22,7 +22,7 @@ public class SDKConfiguration {
private static final String LANGUAGE = "java";
public static final String OPENAPI_DOC_VERSION = "1.0.0";
- public static final String SDK_VERSION = "2.16.6";
+ public static final String SDK_VERSION = "2.16.7";
public static final String GEN_VERSION = "2.791.1";
private static final String BASE_PACKAGE = "com.gr4vy.sdk";
public static final String USER_AGENT =
diff --git a/src/main/java/com/gr4vy/sdk/Transactions.java b/src/main/java/com/gr4vy/sdk/Transactions.java
index a7c2a341..a7117f3c 100644
--- a/src/main/java/com/gr4vy/sdk/Transactions.java
+++ b/src/main/java/com/gr4vy/sdk/Transactions.java
@@ -53,12 +53,14 @@ public class Transactions {
private final SDKConfiguration sdkConfiguration;
private final AsyncTransactions asyncSDK;
private final TransactionsRefunds refunds;
+ private final Actions actions;
private final Events events;
private final Settlements settlements;
Transactions(SDKConfiguration sdkConfiguration) {
this.sdkConfiguration = sdkConfiguration;
this.refunds = new TransactionsRefunds(this.sdkConfiguration);
+ this.actions = new Actions(this.sdkConfiguration);
this.events = new Events(this.sdkConfiguration);
this.settlements = new Settlements(this.sdkConfiguration);
this.asyncSDK = new AsyncTransactions(this, sdkConfiguration);
@@ -68,6 +70,10 @@ public final TransactionsRefunds refunds() {
return refunds;
}
+ public final Actions actions() {
+ return actions;
+ }
+
public final Events events() {
return events;
}
diff --git a/src/main/java/com/gr4vy/sdk/models/components/Flow.java b/src/main/java/com/gr4vy/sdk/models/components/Flow.java
new file mode 100644
index 00000000..685c5d86
--- /dev/null
+++ b/src/main/java/com/gr4vy/sdk/models/components/Flow.java
@@ -0,0 +1,135 @@
+/*
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
+ */
+package com.gr4vy.sdk.models.components;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonValue;
+import java.lang.Override;
+import java.lang.String;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Optional;
+
+/**
+ * Wrapper for an "open" enum that can handle unknown values from API responses
+ * without runtime errors. Instances are immutable singletons with reference equality.
+ * Use {@code asEnum()} for switch expressions.
+ */
+public class Flow {
+
+ public static final Flow CHECKOUT = new Flow("checkout");
+ public static final Flow CARD_TRANSACTION = new Flow("card-transaction");
+ public static final Flow NON_CARD_TRANSACTION = new Flow("non-card-transaction");
+ public static final Flow REDIRECT_TRANSACTION = new Flow("redirect-transaction");
+
+ // This map will grow whenever a Color gets created with a new
+ // unrecognized value (a potential memory leak if the user is not
+ // careful). Keep this field lower case to avoid clashing with
+ // generated member names which will always be upper cased (Java
+ // convention)
+ private static final Map values = createValuesMap();
+ private static final Map enums = createEnumsMap();
+
+ private final String value;
+
+ private Flow(String value) {
+ this.value = value;
+ }
+
+ /**
+ * Returns a Flow with the given value. For a specific value the
+ * returned object will always be a singleton so reference equality
+ * is satisfied when the values are the same.
+ *
+ * @param value value to be wrapped as Flow
+ */
+ @JsonCreator
+ public static Flow of(String value) {
+ synchronized (Flow.class) {
+ return values.computeIfAbsent(value, v -> new Flow(v));
+ }
+ }
+
+ @JsonValue
+ public String value() {
+ return value;
+ }
+
+ public Optional asEnum() {
+ return Optional.ofNullable(enums.getOrDefault(value, null));
+ }
+
+ public boolean isKnown() {
+ return asEnum().isPresent();
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(value);
+ }
+
+ @Override
+ public boolean equals(java.lang.Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ Flow other = (Flow) obj;
+ return Objects.equals(value, other.value);
+ }
+
+ @Override
+ public String toString() {
+ return "Flow [value=" + value + "]";
+ }
+
+ // return an array just like an enum
+ public static Flow[] values() {
+ synchronized (Flow.class) {
+ return values.values().toArray(new Flow[] {});
+ }
+ }
+
+ private static final Map createValuesMap() {
+ Map map = new LinkedHashMap<>();
+ map.put("checkout", CHECKOUT);
+ map.put("card-transaction", CARD_TRANSACTION);
+ map.put("non-card-transaction", NON_CARD_TRANSACTION);
+ map.put("redirect-transaction", REDIRECT_TRANSACTION);
+ return map;
+ }
+
+ private static final Map createEnumsMap() {
+ Map map = new HashMap<>();
+ map.put("checkout", FlowEnum.CHECKOUT);
+ map.put("card-transaction", FlowEnum.CARD_TRANSACTION);
+ map.put("non-card-transaction", FlowEnum.NON_CARD_TRANSACTION);
+ map.put("redirect-transaction", FlowEnum.REDIRECT_TRANSACTION);
+ return map;
+ }
+
+
+ public enum FlowEnum {
+
+ CHECKOUT("checkout"),
+ CARD_TRANSACTION("card-transaction"),
+ NON_CARD_TRANSACTION("non-card-transaction"),
+ REDIRECT_TRANSACTION("redirect-transaction"),;
+
+ private final String value;
+
+ private FlowEnum(String value) {
+ this.value = value;
+ }
+
+ public String value() {
+ return value;
+ }
+ }
+}
+
diff --git a/src/main/java/com/gr4vy/sdk/models/components/FlowAction.java b/src/main/java/com/gr4vy/sdk/models/components/FlowAction.java
new file mode 100644
index 00000000..abf8340b
--- /dev/null
+++ b/src/main/java/com/gr4vy/sdk/models/components/FlowAction.java
@@ -0,0 +1,135 @@
+/*
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
+ */
+package com.gr4vy.sdk.models.components;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonValue;
+import java.lang.Override;
+import java.lang.String;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Optional;
+
+/**
+ * Wrapper for an "open" enum that can handle unknown values from API responses
+ * without runtime errors. Instances are immutable singletons with reference equality.
+ * Use {@code asEnum()} for switch expressions.
+ */
+public class FlowAction {
+
+ public static final FlowAction SELECT_PAYMENT_OPTIONS = new FlowAction("select-payment-options");
+ public static final FlowAction ROUTE_TRANSACTION = new FlowAction("route-transaction");
+ public static final FlowAction DECLINE_EARLY = new FlowAction("decline-early");
+ public static final FlowAction SKIP3DS = new FlowAction("skip-3ds");
+
+ // This map will grow whenever a Color gets created with a new
+ // unrecognized value (a potential memory leak if the user is not
+ // careful). Keep this field lower case to avoid clashing with
+ // generated member names which will always be upper cased (Java
+ // convention)
+ private static final Map values = createValuesMap();
+ private static final Map enums = createEnumsMap();
+
+ private final String value;
+
+ private FlowAction(String value) {
+ this.value = value;
+ }
+
+ /**
+ * Returns a FlowAction with the given value. For a specific value the
+ * returned object will always be a singleton so reference equality
+ * is satisfied when the values are the same.
+ *
+ * @param value value to be wrapped as FlowAction
+ */
+ @JsonCreator
+ public static FlowAction of(String value) {
+ synchronized (FlowAction.class) {
+ return values.computeIfAbsent(value, v -> new FlowAction(v));
+ }
+ }
+
+ @JsonValue
+ public String value() {
+ return value;
+ }
+
+ public Optional asEnum() {
+ return Optional.ofNullable(enums.getOrDefault(value, null));
+ }
+
+ public boolean isKnown() {
+ return asEnum().isPresent();
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(value);
+ }
+
+ @Override
+ public boolean equals(java.lang.Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ FlowAction other = (FlowAction) obj;
+ return Objects.equals(value, other.value);
+ }
+
+ @Override
+ public String toString() {
+ return "FlowAction [value=" + value + "]";
+ }
+
+ // return an array just like an enum
+ public static FlowAction[] values() {
+ synchronized (FlowAction.class) {
+ return values.values().toArray(new FlowAction[] {});
+ }
+ }
+
+ private static final Map createValuesMap() {
+ Map map = new LinkedHashMap<>();
+ map.put("select-payment-options", SELECT_PAYMENT_OPTIONS);
+ map.put("route-transaction", ROUTE_TRANSACTION);
+ map.put("decline-early", DECLINE_EARLY);
+ map.put("skip-3ds", SKIP3DS);
+ return map;
+ }
+
+ private static final Map createEnumsMap() {
+ Map map = new HashMap<>();
+ map.put("select-payment-options", FlowActionEnum.SELECT_PAYMENT_OPTIONS);
+ map.put("route-transaction", FlowActionEnum.ROUTE_TRANSACTION);
+ map.put("decline-early", FlowActionEnum.DECLINE_EARLY);
+ map.put("skip-3ds", FlowActionEnum.SKIP3DS);
+ return map;
+ }
+
+
+ public enum FlowActionEnum {
+
+ SELECT_PAYMENT_OPTIONS("select-payment-options"),
+ ROUTE_TRANSACTION("route-transaction"),
+ DECLINE_EARLY("decline-early"),
+ SKIP3DS("skip-3ds"),;
+
+ private final String value;
+
+ private FlowActionEnum(String value) {
+ this.value = value;
+ }
+
+ public String value() {
+ return value;
+ }
+ }
+}
+
diff --git a/src/main/java/com/gr4vy/sdk/models/components/TransactionAction.java b/src/main/java/com/gr4vy/sdk/models/components/TransactionAction.java
new file mode 100644
index 00000000..ef47fcd9
--- /dev/null
+++ b/src/main/java/com/gr4vy/sdk/models/components/TransactionAction.java
@@ -0,0 +1,274 @@
+/*
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
+ */
+package com.gr4vy.sdk.models.components;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude.Include;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.core.type.TypeReference;
+import com.gr4vy.sdk.utils.LazySingletonValue;
+import com.gr4vy.sdk.utils.Utils;
+import java.lang.Object;
+import java.lang.Override;
+import java.lang.String;
+import java.time.OffsetDateTime;
+import java.util.Map;
+import java.util.Optional;
+
+
+public class TransactionAction {
+ /**
+ * Always `action`.
+ */
+ @JsonInclude(Include.NON_ABSENT)
+ @JsonProperty("type")
+ private Optional type;
+
+
+ @JsonProperty("id")
+ private FlowAction id;
+
+
+ @JsonProperty("flow")
+ private Flow flow;
+
+ /**
+ * The ID of the rule that triggered this action.
+ */
+ @JsonProperty("rule_id")
+ private String ruleId;
+
+ /**
+ * The date this action was created at.
+ */
+ @JsonProperty("created_at")
+ private OffsetDateTime createdAt;
+
+ /**
+ * The outcome of the action.
+ */
+ @JsonProperty("outcome")
+ private Map outcome;
+
+ @JsonCreator
+ public TransactionAction(
+ @JsonProperty("id") FlowAction id,
+ @JsonProperty("flow") Flow flow,
+ @JsonProperty("rule_id") String ruleId,
+ @JsonProperty("created_at") OffsetDateTime createdAt,
+ @JsonProperty("outcome") Map outcome) {
+ Utils.checkNotNull(id, "id");
+ Utils.checkNotNull(flow, "flow");
+ Utils.checkNotNull(ruleId, "ruleId");
+ Utils.checkNotNull(createdAt, "createdAt");
+ outcome = Utils.emptyMapIfNull(outcome);
+ Utils.checkNotNull(outcome, "outcome");
+ this.type = Builder._SINGLETON_VALUE_Type.value();
+ this.id = id;
+ this.flow = flow;
+ this.ruleId = ruleId;
+ this.createdAt = createdAt;
+ this.outcome = outcome;
+ }
+
+ /**
+ * Always `action`.
+ */
+ @JsonIgnore
+ public Optional type() {
+ return type;
+ }
+
+ @JsonIgnore
+ public FlowAction id() {
+ return id;
+ }
+
+ @JsonIgnore
+ public Flow flow() {
+ return flow;
+ }
+
+ /**
+ * The ID of the rule that triggered this action.
+ */
+ @JsonIgnore
+ public String ruleId() {
+ return ruleId;
+ }
+
+ /**
+ * The date this action was created at.
+ */
+ @JsonIgnore
+ public OffsetDateTime createdAt() {
+ return createdAt;
+ }
+
+ /**
+ * The outcome of the action.
+ */
+ @JsonIgnore
+ public Map outcome() {
+ return outcome;
+ }
+
+ public static Builder builder() {
+ return new Builder();
+ }
+
+
+ public TransactionAction withId(FlowAction id) {
+ Utils.checkNotNull(id, "id");
+ this.id = id;
+ return this;
+ }
+
+ public TransactionAction withFlow(Flow flow) {
+ Utils.checkNotNull(flow, "flow");
+ this.flow = flow;
+ return this;
+ }
+
+ /**
+ * The ID of the rule that triggered this action.
+ */
+ public TransactionAction withRuleId(String ruleId) {
+ Utils.checkNotNull(ruleId, "ruleId");
+ this.ruleId = ruleId;
+ return this;
+ }
+
+ /**
+ * The date this action was created at.
+ */
+ public TransactionAction withCreatedAt(OffsetDateTime createdAt) {
+ Utils.checkNotNull(createdAt, "createdAt");
+ this.createdAt = createdAt;
+ return this;
+ }
+
+ /**
+ * The outcome of the action.
+ */
+ public TransactionAction withOutcome(Map outcome) {
+ Utils.checkNotNull(outcome, "outcome");
+ this.outcome = outcome;
+ return this;
+ }
+
+ @Override
+ public boolean equals(java.lang.Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ TransactionAction other = (TransactionAction) o;
+ return
+ Utils.enhancedDeepEquals(this.type, other.type) &&
+ Utils.enhancedDeepEquals(this.id, other.id) &&
+ Utils.enhancedDeepEquals(this.flow, other.flow) &&
+ Utils.enhancedDeepEquals(this.ruleId, other.ruleId) &&
+ Utils.enhancedDeepEquals(this.createdAt, other.createdAt) &&
+ Utils.enhancedDeepEquals(this.outcome, other.outcome);
+ }
+
+ @Override
+ public int hashCode() {
+ return Utils.enhancedHash(
+ type, id, flow,
+ ruleId, createdAt, outcome);
+ }
+
+ @Override
+ public String toString() {
+ return Utils.toString(TransactionAction.class,
+ "type", type,
+ "id", id,
+ "flow", flow,
+ "ruleId", ruleId,
+ "createdAt", createdAt,
+ "outcome", outcome);
+ }
+
+ @SuppressWarnings("UnusedReturnValue")
+ public final static class Builder {
+
+ private FlowAction id;
+
+ private Flow flow;
+
+ private String ruleId;
+
+ private OffsetDateTime createdAt;
+
+ private Map outcome;
+
+ private Builder() {
+ // force use of static builder() method
+ }
+
+
+ public Builder id(FlowAction id) {
+ Utils.checkNotNull(id, "id");
+ this.id = id;
+ return this;
+ }
+
+
+ public Builder flow(Flow flow) {
+ Utils.checkNotNull(flow, "flow");
+ this.flow = flow;
+ return this;
+ }
+
+
+ /**
+ * The ID of the rule that triggered this action.
+ */
+ public Builder ruleId(String ruleId) {
+ Utils.checkNotNull(ruleId, "ruleId");
+ this.ruleId = ruleId;
+ return this;
+ }
+
+
+ /**
+ * The date this action was created at.
+ */
+ public Builder createdAt(OffsetDateTime createdAt) {
+ Utils.checkNotNull(createdAt, "createdAt");
+ this.createdAt = createdAt;
+ return this;
+ }
+
+
+ /**
+ * The outcome of the action.
+ */
+ public Builder outcome(Map outcome) {
+ Utils.checkNotNull(outcome, "outcome");
+ this.outcome = outcome;
+ return this;
+ }
+
+ public TransactionAction build() {
+
+ return new TransactionAction(
+ id, flow, ruleId,
+ createdAt, outcome);
+ }
+
+
+ private static final LazySingletonValue> _SINGLETON_VALUE_Type =
+ new LazySingletonValue<>(
+ "type",
+ "\"action\"",
+ new TypeReference>() {});
+ }
+}
diff --git a/src/main/java/com/gr4vy/sdk/models/components/TransactionActions.java b/src/main/java/com/gr4vy/sdk/models/components/TransactionActions.java
new file mode 100644
index 00000000..8e5f4ed9
--- /dev/null
+++ b/src/main/java/com/gr4vy/sdk/models/components/TransactionActions.java
@@ -0,0 +1,102 @@
+/*
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
+ */
+package com.gr4vy.sdk.models.components;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.gr4vy.sdk.utils.Utils;
+import java.lang.Override;
+import java.lang.String;
+import java.util.List;
+
+
+public class TransactionActions {
+ /**
+ * The list of actions triggered for a transaction.
+ */
+ @JsonProperty("items")
+ private List items;
+
+ @JsonCreator
+ public TransactionActions(
+ @JsonProperty("items") List items) {
+ Utils.checkNotNull(items, "items");
+ this.items = items;
+ }
+
+ /**
+ * The list of actions triggered for a transaction.
+ */
+ @JsonIgnore
+ public List items() {
+ return items;
+ }
+
+ public static Builder builder() {
+ return new Builder();
+ }
+
+
+ /**
+ * The list of actions triggered for a transaction.
+ */
+ public TransactionActions withItems(List items) {
+ Utils.checkNotNull(items, "items");
+ this.items = items;
+ return this;
+ }
+
+ @Override
+ public boolean equals(java.lang.Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ TransactionActions other = (TransactionActions) o;
+ return
+ Utils.enhancedDeepEquals(this.items, other.items);
+ }
+
+ @Override
+ public int hashCode() {
+ return Utils.enhancedHash(
+ items);
+ }
+
+ @Override
+ public String toString() {
+ return Utils.toString(TransactionActions.class,
+ "items", items);
+ }
+
+ @SuppressWarnings("UnusedReturnValue")
+ public final static class Builder {
+
+ private List items;
+
+ private Builder() {
+ // force use of static builder() method
+ }
+
+
+ /**
+ * The list of actions triggered for a transaction.
+ */
+ public Builder items(List items) {
+ Utils.checkNotNull(items, "items");
+ this.items = items;
+ return this;
+ }
+
+ public TransactionActions build() {
+
+ return new TransactionActions(
+ items);
+ }
+
+ }
+}
diff --git a/src/main/java/com/gr4vy/sdk/models/operations/ListTransactionActionsRequest.java b/src/main/java/com/gr4vy/sdk/models/operations/ListTransactionActionsRequest.java
new file mode 100644
index 00000000..0e421f36
--- /dev/null
+++ b/src/main/java/com/gr4vy/sdk/models/operations/ListTransactionActionsRequest.java
@@ -0,0 +1,165 @@
+/*
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
+ */
+package com.gr4vy.sdk.models.operations;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.gr4vy.sdk.utils.SpeakeasyMetadata;
+import com.gr4vy.sdk.utils.Utils;
+import java.lang.Override;
+import java.lang.String;
+import org.openapitools.jackson.nullable.JsonNullable;
+
+
+public class ListTransactionActionsRequest {
+ /**
+ * The ID of the transaction
+ */
+ @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=transaction_id")
+ private String transactionId;
+
+ /**
+ * The ID of the merchant account to use for this request.
+ */
+ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-gr4vy-merchant-account-id")
+ private JsonNullable merchantAccountId;
+
+ @JsonCreator
+ public ListTransactionActionsRequest(
+ String transactionId,
+ JsonNullable merchantAccountId) {
+ Utils.checkNotNull(transactionId, "transactionId");
+ Utils.checkNotNull(merchantAccountId, "merchantAccountId");
+ this.transactionId = transactionId;
+ this.merchantAccountId = merchantAccountId;
+ }
+
+ public ListTransactionActionsRequest(
+ String transactionId) {
+ this(transactionId, JsonNullable.undefined());
+ }
+
+ /**
+ * The ID of the transaction
+ */
+ @JsonIgnore
+ public String transactionId() {
+ return transactionId;
+ }
+
+ /**
+ * The ID of the merchant account to use for this request.
+ */
+ @JsonIgnore
+ public JsonNullable merchantAccountId() {
+ return merchantAccountId;
+ }
+
+ public static Builder builder() {
+ return new Builder();
+ }
+
+
+ /**
+ * The ID of the transaction
+ */
+ public ListTransactionActionsRequest withTransactionId(String transactionId) {
+ Utils.checkNotNull(transactionId, "transactionId");
+ this.transactionId = transactionId;
+ return this;
+ }
+
+ /**
+ * The ID of the merchant account to use for this request.
+ */
+ public ListTransactionActionsRequest withMerchantAccountId(String merchantAccountId) {
+ Utils.checkNotNull(merchantAccountId, "merchantAccountId");
+ this.merchantAccountId = JsonNullable.of(merchantAccountId);
+ return this;
+ }
+
+ /**
+ * The ID of the merchant account to use for this request.
+ */
+ public ListTransactionActionsRequest withMerchantAccountId(JsonNullable merchantAccountId) {
+ Utils.checkNotNull(merchantAccountId, "merchantAccountId");
+ this.merchantAccountId = merchantAccountId;
+ return this;
+ }
+
+ @Override
+ public boolean equals(java.lang.Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ ListTransactionActionsRequest other = (ListTransactionActionsRequest) o;
+ return
+ Utils.enhancedDeepEquals(this.transactionId, other.transactionId) &&
+ Utils.enhancedDeepEquals(this.merchantAccountId, other.merchantAccountId);
+ }
+
+ @Override
+ public int hashCode() {
+ return Utils.enhancedHash(
+ transactionId, merchantAccountId);
+ }
+
+ @Override
+ public String toString() {
+ return Utils.toString(ListTransactionActionsRequest.class,
+ "transactionId", transactionId,
+ "merchantAccountId", merchantAccountId);
+ }
+
+ @SuppressWarnings("UnusedReturnValue")
+ public final static class Builder {
+
+ private String transactionId;
+
+ private JsonNullable merchantAccountId = JsonNullable.undefined();
+
+ private Builder() {
+ // force use of static builder() method
+ }
+
+
+ /**
+ * The ID of the transaction
+ */
+ public Builder transactionId(String transactionId) {
+ Utils.checkNotNull(transactionId, "transactionId");
+ this.transactionId = transactionId;
+ return this;
+ }
+
+
+ /**
+ * The ID of the merchant account to use for this request.
+ */
+ public Builder merchantAccountId(String merchantAccountId) {
+ Utils.checkNotNull(merchantAccountId, "merchantAccountId");
+ this.merchantAccountId = JsonNullable.of(merchantAccountId);
+ return this;
+ }
+
+ /**
+ * The ID of the merchant account to use for this request.
+ */
+ public Builder merchantAccountId(JsonNullable merchantAccountId) {
+ Utils.checkNotNull(merchantAccountId, "merchantAccountId");
+ this.merchantAccountId = merchantAccountId;
+ return this;
+ }
+
+ public ListTransactionActionsRequest build() {
+
+ return new ListTransactionActionsRequest(
+ transactionId, merchantAccountId);
+ }
+
+ }
+}
diff --git a/src/main/java/com/gr4vy/sdk/models/operations/ListTransactionActionsRequestBuilder.java b/src/main/java/com/gr4vy/sdk/models/operations/ListTransactionActionsRequestBuilder.java
new file mode 100644
index 00000000..19240efb
--- /dev/null
+++ b/src/main/java/com/gr4vy/sdk/models/operations/ListTransactionActionsRequestBuilder.java
@@ -0,0 +1,80 @@
+/*
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
+ */
+package com.gr4vy.sdk.models.operations;
+
+import static com.gr4vy.sdk.operations.Operations.RequestOperation;
+
+import com.gr4vy.sdk.SDKConfiguration;
+import com.gr4vy.sdk.operations.ListTransactionActions;
+import com.gr4vy.sdk.utils.Headers;
+import com.gr4vy.sdk.utils.Options;
+import com.gr4vy.sdk.utils.RetryConfig;
+import com.gr4vy.sdk.utils.Utils;
+import java.lang.String;
+import java.util.Optional;
+import org.openapitools.jackson.nullable.JsonNullable;
+
+public class ListTransactionActionsRequestBuilder {
+
+ private String transactionId;
+ private JsonNullable merchantAccountId = JsonNullable.undefined();
+ private Optional retryConfig = Optional.empty();
+ private final SDKConfiguration sdkConfiguration;
+ private final Headers _headers = new Headers();
+
+ public ListTransactionActionsRequestBuilder(SDKConfiguration sdkConfiguration) {
+ this.sdkConfiguration = sdkConfiguration;
+ }
+
+ public ListTransactionActionsRequestBuilder transactionId(String transactionId) {
+ Utils.checkNotNull(transactionId, "transactionId");
+ this.transactionId = transactionId;
+ return this;
+ }
+
+ public ListTransactionActionsRequestBuilder merchantAccountId(String merchantAccountId) {
+ Utils.checkNotNull(merchantAccountId, "merchantAccountId");
+ this.merchantAccountId = JsonNullable.of(merchantAccountId);
+ return this;
+ }
+
+ public ListTransactionActionsRequestBuilder merchantAccountId(JsonNullable merchantAccountId) {
+ Utils.checkNotNull(merchantAccountId, "merchantAccountId");
+ this.merchantAccountId = merchantAccountId;
+ return this;
+ }
+
+ public ListTransactionActionsRequestBuilder retryConfig(RetryConfig retryConfig) {
+ Utils.checkNotNull(retryConfig, "retryConfig");
+ this.retryConfig = Optional.of(retryConfig);
+ return this;
+ }
+
+ public ListTransactionActionsRequestBuilder retryConfig(Optional retryConfig) {
+ Utils.checkNotNull(retryConfig, "retryConfig");
+ this.retryConfig = retryConfig;
+ return this;
+ }
+
+
+ private ListTransactionActionsRequest buildRequest() {
+
+ ListTransactionActionsRequest request = new ListTransactionActionsRequest(transactionId,
+ merchantAccountId);
+
+ return request;
+ }
+
+ public ListTransactionActionsResponse call() {
+ Optional options = Optional.of(Options.builder()
+ .retryConfig(retryConfig)
+ .build());
+
+ RequestOperation operation
+ = new ListTransactionActions.Sync(sdkConfiguration, options, _headers);
+ ListTransactionActionsRequest request = buildRequest();
+
+ return operation.handleResponse(operation.doRequest(request));
+ }
+}
diff --git a/src/main/java/com/gr4vy/sdk/models/operations/ListTransactionActionsResponse.java b/src/main/java/com/gr4vy/sdk/models/operations/ListTransactionActionsResponse.java
new file mode 100644
index 00000000..161432ff
--- /dev/null
+++ b/src/main/java/com/gr4vy/sdk/models/operations/ListTransactionActionsResponse.java
@@ -0,0 +1,253 @@
+/*
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
+ */
+package com.gr4vy.sdk.models.operations;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.gr4vy.sdk.models.components.TransactionActions;
+import com.gr4vy.sdk.utils.Response;
+import com.gr4vy.sdk.utils.Utils;
+import java.io.InputStream;
+import java.lang.Integer;
+import java.lang.Override;
+import java.lang.String;
+import java.lang.SuppressWarnings;
+import java.net.http.HttpResponse;
+import java.util.Optional;
+
+
+public class ListTransactionActionsResponse implements Response {
+ /**
+ * HTTP response content type for this operation
+ */
+ private String contentType;
+
+ /**
+ * HTTP response status code for this operation
+ */
+ private int statusCode;
+
+ /**
+ * Raw HTTP response; suitable for custom response parsing
+ */
+ private HttpResponse rawResponse;
+
+ /**
+ * Successful Response
+ */
+ private Optional extends TransactionActions> transactionActions;
+
+ @JsonCreator
+ public ListTransactionActionsResponse(
+ String contentType,
+ int statusCode,
+ HttpResponse rawResponse,
+ Optional extends TransactionActions> transactionActions) {
+ Utils.checkNotNull(contentType, "contentType");
+ Utils.checkNotNull(statusCode, "statusCode");
+ Utils.checkNotNull(rawResponse, "rawResponse");
+ Utils.checkNotNull(transactionActions, "transactionActions");
+ this.contentType = contentType;
+ this.statusCode = statusCode;
+ this.rawResponse = rawResponse;
+ this.transactionActions = transactionActions;
+ }
+
+ public ListTransactionActionsResponse(
+ String contentType,
+ int statusCode,
+ HttpResponse rawResponse) {
+ this(contentType, statusCode, rawResponse,
+ Optional.empty());
+ }
+
+ /**
+ * HTTP response content type for this operation
+ */
+ @JsonIgnore
+ public String contentType() {
+ return contentType;
+ }
+
+ /**
+ * HTTP response status code for this operation
+ */
+ @JsonIgnore
+ public int statusCode() {
+ return statusCode;
+ }
+
+ /**
+ * Raw HTTP response; suitable for custom response parsing
+ */
+ @JsonIgnore
+ public HttpResponse rawResponse() {
+ return rawResponse;
+ }
+
+ /**
+ * Successful Response
+ */
+ @SuppressWarnings("unchecked")
+ @JsonIgnore
+ public Optional transactionActions() {
+ return (Optional) transactionActions;
+ }
+
+ public static Builder builder() {
+ return new Builder();
+ }
+
+
+ /**
+ * HTTP response content type for this operation
+ */
+ public ListTransactionActionsResponse withContentType(String contentType) {
+ Utils.checkNotNull(contentType, "contentType");
+ this.contentType = contentType;
+ return this;
+ }
+
+ /**
+ * HTTP response status code for this operation
+ */
+ public ListTransactionActionsResponse withStatusCode(int statusCode) {
+ Utils.checkNotNull(statusCode, "statusCode");
+ this.statusCode = statusCode;
+ return this;
+ }
+
+ /**
+ * Raw HTTP response; suitable for custom response parsing
+ */
+ public ListTransactionActionsResponse withRawResponse(HttpResponse rawResponse) {
+ Utils.checkNotNull(rawResponse, "rawResponse");
+ this.rawResponse = rawResponse;
+ return this;
+ }
+
+ /**
+ * Successful Response
+ */
+ public ListTransactionActionsResponse withTransactionActions(TransactionActions transactionActions) {
+ Utils.checkNotNull(transactionActions, "transactionActions");
+ this.transactionActions = Optional.ofNullable(transactionActions);
+ return this;
+ }
+
+
+ /**
+ * Successful Response
+ */
+ public ListTransactionActionsResponse withTransactionActions(Optional extends TransactionActions> transactionActions) {
+ Utils.checkNotNull(transactionActions, "transactionActions");
+ this.transactionActions = transactionActions;
+ return this;
+ }
+
+ @Override
+ public boolean equals(java.lang.Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ ListTransactionActionsResponse other = (ListTransactionActionsResponse) o;
+ return
+ Utils.enhancedDeepEquals(this.contentType, other.contentType) &&
+ Utils.enhancedDeepEquals(this.statusCode, other.statusCode) &&
+ Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) &&
+ Utils.enhancedDeepEquals(this.transactionActions, other.transactionActions);
+ }
+
+ @Override
+ public int hashCode() {
+ return Utils.enhancedHash(
+ contentType, statusCode, rawResponse,
+ transactionActions);
+ }
+
+ @Override
+ public String toString() {
+ return Utils.toString(ListTransactionActionsResponse.class,
+ "contentType", contentType,
+ "statusCode", statusCode,
+ "rawResponse", rawResponse,
+ "transactionActions", transactionActions);
+ }
+
+ @SuppressWarnings("UnusedReturnValue")
+ public final static class Builder {
+
+ private String contentType;
+
+ private Integer statusCode;
+
+ private HttpResponse rawResponse;
+
+ private Optional extends TransactionActions> transactionActions = Optional.empty();
+
+ private Builder() {
+ // force use of static builder() method
+ }
+
+
+ /**
+ * HTTP response content type for this operation
+ */
+ public Builder contentType(String contentType) {
+ Utils.checkNotNull(contentType, "contentType");
+ this.contentType = contentType;
+ return this;
+ }
+
+
+ /**
+ * HTTP response status code for this operation
+ */
+ public Builder statusCode(int statusCode) {
+ Utils.checkNotNull(statusCode, "statusCode");
+ this.statusCode = statusCode;
+ return this;
+ }
+
+
+ /**
+ * Raw HTTP response; suitable for custom response parsing
+ */
+ public Builder rawResponse(HttpResponse rawResponse) {
+ Utils.checkNotNull(rawResponse, "rawResponse");
+ this.rawResponse = rawResponse;
+ return this;
+ }
+
+
+ /**
+ * Successful Response
+ */
+ public Builder transactionActions(TransactionActions transactionActions) {
+ Utils.checkNotNull(transactionActions, "transactionActions");
+ this.transactionActions = Optional.ofNullable(transactionActions);
+ return this;
+ }
+
+ /**
+ * Successful Response
+ */
+ public Builder transactionActions(Optional extends TransactionActions> transactionActions) {
+ Utils.checkNotNull(transactionActions, "transactionActions");
+ this.transactionActions = transactionActions;
+ return this;
+ }
+
+ public ListTransactionActionsResponse build() {
+
+ return new ListTransactionActionsResponse(
+ contentType, statusCode, rawResponse,
+ transactionActions);
+ }
+
+ }
+}
diff --git a/src/main/java/com/gr4vy/sdk/models/operations/async/ListTransactionActionsRequestBuilder.java b/src/main/java/com/gr4vy/sdk/models/operations/async/ListTransactionActionsRequestBuilder.java
new file mode 100644
index 00000000..773e7537
--- /dev/null
+++ b/src/main/java/com/gr4vy/sdk/models/operations/async/ListTransactionActionsRequestBuilder.java
@@ -0,0 +1,85 @@
+/*
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
+ */
+package com.gr4vy.sdk.models.operations.async;
+
+import static com.gr4vy.sdk.operations.Operations.AsyncRequestOperation;
+
+import com.gr4vy.sdk.SDKConfiguration;
+import com.gr4vy.sdk.models.operations.ListTransactionActionsRequest;
+import com.gr4vy.sdk.operations.ListTransactionActions;
+import com.gr4vy.sdk.utils.Headers;
+import com.gr4vy.sdk.utils.Options;
+import com.gr4vy.sdk.utils.RetryConfig;
+import com.gr4vy.sdk.utils.Utils;
+import java.lang.String;
+import java.util.Optional;
+import java.util.concurrent.CompletableFuture;
+import org.openapitools.jackson.nullable.JsonNullable;
+
+public class ListTransactionActionsRequestBuilder {
+
+ private String transactionId;
+ private JsonNullable merchantAccountId = JsonNullable.undefined();
+ private Optional retryConfig = Optional.empty();
+ private final SDKConfiguration sdkConfiguration;
+ private final Headers _headers = new Headers();
+
+ public ListTransactionActionsRequestBuilder(SDKConfiguration sdkConfiguration) {
+ this.sdkConfiguration = sdkConfiguration;
+ }
+
+ public ListTransactionActionsRequestBuilder transactionId(String transactionId) {
+ Utils.checkNotNull(transactionId, "transactionId");
+ this.transactionId = transactionId;
+ return this;
+ }
+
+ public ListTransactionActionsRequestBuilder merchantAccountId(String merchantAccountId) {
+ Utils.checkNotNull(merchantAccountId, "merchantAccountId");
+ this.merchantAccountId = JsonNullable.of(merchantAccountId);
+ return this;
+ }
+
+ public ListTransactionActionsRequestBuilder merchantAccountId(JsonNullable merchantAccountId) {
+ Utils.checkNotNull(merchantAccountId, "merchantAccountId");
+ this.merchantAccountId = merchantAccountId;
+ return this;
+ }
+
+ public ListTransactionActionsRequestBuilder retryConfig(RetryConfig retryConfig) {
+ Utils.checkNotNull(retryConfig, "retryConfig");
+ this.retryConfig = Optional.of(retryConfig);
+ return this;
+ }
+
+ public ListTransactionActionsRequestBuilder retryConfig(Optional retryConfig) {
+ Utils.checkNotNull(retryConfig, "retryConfig");
+ this.retryConfig = retryConfig;
+ return this;
+ }
+
+
+ private ListTransactionActionsRequest buildRequest() {
+
+ ListTransactionActionsRequest request = new ListTransactionActionsRequest(transactionId,
+ merchantAccountId);
+
+ return request;
+ }
+
+ public CompletableFuture call() {
+ Optional options = Optional.of(Options.builder()
+ .retryConfig(retryConfig)
+ .build());
+
+ AsyncRequestOperation operation
+ = new ListTransactionActions.Async(
+ sdkConfiguration, options, sdkConfiguration.retryScheduler(),
+ _headers);
+ ListTransactionActionsRequest request = buildRequest();
+
+ return operation.doRequest(request)
+ .thenCompose(operation::handleResponse);
+ }
+}
diff --git a/src/main/java/com/gr4vy/sdk/models/operations/async/ListTransactionActionsResponse.java b/src/main/java/com/gr4vy/sdk/models/operations/async/ListTransactionActionsResponse.java
new file mode 100644
index 00000000..9fe912e3
--- /dev/null
+++ b/src/main/java/com/gr4vy/sdk/models/operations/async/ListTransactionActionsResponse.java
@@ -0,0 +1,253 @@
+/*
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
+ */
+package com.gr4vy.sdk.models.operations.async;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.gr4vy.sdk.models.components.TransactionActions;
+import com.gr4vy.sdk.utils.AsyncResponse;
+import com.gr4vy.sdk.utils.Blob;
+import com.gr4vy.sdk.utils.Utils;
+import java.lang.Integer;
+import java.lang.Override;
+import java.lang.String;
+import java.lang.SuppressWarnings;
+import java.net.http.HttpResponse;
+import java.util.Optional;
+
+
+public class ListTransactionActionsResponse implements AsyncResponse {
+ /**
+ * HTTP response content type for this operation
+ */
+ private String contentType;
+
+ /**
+ * HTTP response status code for this operation
+ */
+ private int statusCode;
+
+ /**
+ * Raw HTTP response; suitable for custom response parsing
+ */
+ private HttpResponse rawResponse;
+
+ /**
+ * Successful Response
+ */
+ private Optional extends TransactionActions> transactionActions;
+
+ @JsonCreator
+ public ListTransactionActionsResponse(
+ String contentType,
+ int statusCode,
+ HttpResponse rawResponse,
+ Optional extends TransactionActions> transactionActions) {
+ Utils.checkNotNull(contentType, "contentType");
+ Utils.checkNotNull(statusCode, "statusCode");
+ Utils.checkNotNull(rawResponse, "rawResponse");
+ Utils.checkNotNull(transactionActions, "transactionActions");
+ this.contentType = contentType;
+ this.statusCode = statusCode;
+ this.rawResponse = rawResponse;
+ this.transactionActions = transactionActions;
+ }
+
+ public ListTransactionActionsResponse(
+ String contentType,
+ int statusCode,
+ HttpResponse rawResponse) {
+ this(contentType, statusCode, rawResponse,
+ Optional.empty());
+ }
+
+ /**
+ * HTTP response content type for this operation
+ */
+ @JsonIgnore
+ public String contentType() {
+ return contentType;
+ }
+
+ /**
+ * HTTP response status code for this operation
+ */
+ @JsonIgnore
+ public int statusCode() {
+ return statusCode;
+ }
+
+ /**
+ * Raw HTTP response; suitable for custom response parsing
+ */
+ @JsonIgnore
+ public HttpResponse rawResponse() {
+ return rawResponse;
+ }
+
+ /**
+ * Successful Response
+ */
+ @SuppressWarnings("unchecked")
+ @JsonIgnore
+ public Optional transactionActions() {
+ return (Optional) transactionActions;
+ }
+
+ public static Builder builder() {
+ return new Builder();
+ }
+
+
+ /**
+ * HTTP response content type for this operation
+ */
+ public ListTransactionActionsResponse withContentType(String contentType) {
+ Utils.checkNotNull(contentType, "contentType");
+ this.contentType = contentType;
+ return this;
+ }
+
+ /**
+ * HTTP response status code for this operation
+ */
+ public ListTransactionActionsResponse withStatusCode(int statusCode) {
+ Utils.checkNotNull(statusCode, "statusCode");
+ this.statusCode = statusCode;
+ return this;
+ }
+
+ /**
+ * Raw HTTP response; suitable for custom response parsing
+ */
+ public ListTransactionActionsResponse withRawResponse(HttpResponse rawResponse) {
+ Utils.checkNotNull(rawResponse, "rawResponse");
+ this.rawResponse = rawResponse;
+ return this;
+ }
+
+ /**
+ * Successful Response
+ */
+ public ListTransactionActionsResponse withTransactionActions(TransactionActions transactionActions) {
+ Utils.checkNotNull(transactionActions, "transactionActions");
+ this.transactionActions = Optional.ofNullable(transactionActions);
+ return this;
+ }
+
+
+ /**
+ * Successful Response
+ */
+ public ListTransactionActionsResponse withTransactionActions(Optional extends TransactionActions> transactionActions) {
+ Utils.checkNotNull(transactionActions, "transactionActions");
+ this.transactionActions = transactionActions;
+ return this;
+ }
+
+ @Override
+ public boolean equals(java.lang.Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ ListTransactionActionsResponse other = (ListTransactionActionsResponse) o;
+ return
+ Utils.enhancedDeepEquals(this.contentType, other.contentType) &&
+ Utils.enhancedDeepEquals(this.statusCode, other.statusCode) &&
+ Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) &&
+ Utils.enhancedDeepEquals(this.transactionActions, other.transactionActions);
+ }
+
+ @Override
+ public int hashCode() {
+ return Utils.enhancedHash(
+ contentType, statusCode, rawResponse,
+ transactionActions);
+ }
+
+ @Override
+ public String toString() {
+ return Utils.toString(ListTransactionActionsResponse.class,
+ "contentType", contentType,
+ "statusCode", statusCode,
+ "rawResponse", rawResponse,
+ "transactionActions", transactionActions);
+ }
+
+ @SuppressWarnings("UnusedReturnValue")
+ public final static class Builder {
+
+ private String contentType;
+
+ private Integer statusCode;
+
+ private HttpResponse rawResponse;
+
+ private Optional extends TransactionActions> transactionActions = Optional.empty();
+
+ private Builder() {
+ // force use of static builder() method
+ }
+
+
+ /**
+ * HTTP response content type for this operation
+ */
+ public Builder contentType(String contentType) {
+ Utils.checkNotNull(contentType, "contentType");
+ this.contentType = contentType;
+ return this;
+ }
+
+
+ /**
+ * HTTP response status code for this operation
+ */
+ public Builder statusCode(int statusCode) {
+ Utils.checkNotNull(statusCode, "statusCode");
+ this.statusCode = statusCode;
+ return this;
+ }
+
+
+ /**
+ * Raw HTTP response; suitable for custom response parsing
+ */
+ public Builder rawResponse(HttpResponse rawResponse) {
+ Utils.checkNotNull(rawResponse, "rawResponse");
+ this.rawResponse = rawResponse;
+ return this;
+ }
+
+
+ /**
+ * Successful Response
+ */
+ public Builder transactionActions(TransactionActions transactionActions) {
+ Utils.checkNotNull(transactionActions, "transactionActions");
+ this.transactionActions = Optional.ofNullable(transactionActions);
+ return this;
+ }
+
+ /**
+ * Successful Response
+ */
+ public Builder transactionActions(Optional extends TransactionActions> transactionActions) {
+ Utils.checkNotNull(transactionActions, "transactionActions");
+ this.transactionActions = transactionActions;
+ return this;
+ }
+
+ public ListTransactionActionsResponse build() {
+
+ return new ListTransactionActionsResponse(
+ contentType, statusCode, rawResponse,
+ transactionActions);
+ }
+
+ }
+}
diff --git a/src/main/java/com/gr4vy/sdk/operations/ListTransactionActions.java b/src/main/java/com/gr4vy/sdk/operations/ListTransactionActions.java
new file mode 100644
index 00000000..c22c0f3a
--- /dev/null
+++ b/src/main/java/com/gr4vy/sdk/operations/ListTransactionActions.java
@@ -0,0 +1,493 @@
+/*
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
+ */
+package com.gr4vy.sdk.operations;
+
+import static com.gr4vy.sdk.operations.Operations.RequestOperation;
+import static com.gr4vy.sdk.utils.Exceptions.unchecked;
+import static com.gr4vy.sdk.operations.Operations.AsyncRequestOperation;
+
+import com.fasterxml.jackson.core.type.TypeReference;
+import com.gr4vy.sdk.SDKConfiguration;
+import com.gr4vy.sdk.SecuritySource;
+import com.gr4vy.sdk.models.components.TransactionActions;
+import com.gr4vy.sdk.models.errors.APIException;
+import com.gr4vy.sdk.models.errors.Error400;
+import com.gr4vy.sdk.models.errors.Error401;
+import com.gr4vy.sdk.models.errors.Error403;
+import com.gr4vy.sdk.models.errors.Error404;
+import com.gr4vy.sdk.models.errors.Error405;
+import com.gr4vy.sdk.models.errors.Error409;
+import com.gr4vy.sdk.models.errors.Error425;
+import com.gr4vy.sdk.models.errors.Error429;
+import com.gr4vy.sdk.models.errors.Error500;
+import com.gr4vy.sdk.models.errors.Error502;
+import com.gr4vy.sdk.models.errors.Error504;
+import com.gr4vy.sdk.models.errors.HTTPValidationError;
+import com.gr4vy.sdk.models.operations.ListTransactionActionsRequest;
+import com.gr4vy.sdk.models.operations.ListTransactionActionsResponse;
+import com.gr4vy.sdk.utils.AsyncRetries;
+import com.gr4vy.sdk.utils.BackoffStrategy;
+import com.gr4vy.sdk.utils.Blob;
+import com.gr4vy.sdk.utils.Globals;
+import com.gr4vy.sdk.utils.HTTPClient;
+import com.gr4vy.sdk.utils.HTTPRequest;
+import com.gr4vy.sdk.utils.Headers;
+import com.gr4vy.sdk.utils.Hook.AfterErrorContextImpl;
+import com.gr4vy.sdk.utils.Hook.AfterSuccessContextImpl;
+import com.gr4vy.sdk.utils.Hook.BeforeRequestContextImpl;
+import com.gr4vy.sdk.utils.NonRetryableException;
+import com.gr4vy.sdk.utils.Options;
+import com.gr4vy.sdk.utils.Retries;
+import com.gr4vy.sdk.utils.RetryConfig;
+import com.gr4vy.sdk.utils.Utils;
+import java.io.InputStream;
+import java.lang.Exception;
+import java.lang.String;
+import java.lang.Throwable;
+import java.net.http.HttpRequest;
+import java.net.http.HttpResponse;
+import java.util.List;
+import java.util.Optional;
+import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.TimeUnit;
+import java.util.function.Function;
+
+
+public class ListTransactionActions {
+
+ static abstract class Base {
+ final SDKConfiguration sdkConfiguration;
+ final String baseUrl;
+ final SecuritySource securitySource;
+ final List retryStatusCodes;
+ final RetryConfig retryConfig;
+ final HTTPClient client;
+ final Headers _headers;
+ final Globals operationGlobals;
+
+ public Base(
+ SDKConfiguration sdkConfiguration, Optional options,
+ Headers _headers) {
+ this.sdkConfiguration = sdkConfiguration;
+ this._headers =_headers;
+ this.baseUrl = Utils.templateUrl(
+ this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults());
+ this.securitySource = this.sdkConfiguration.securitySource();
+ options
+ .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG)));
+ this.retryStatusCodes = List.of("5XX");
+ this.retryConfig = options
+ .flatMap(Options::retryConfig)
+ .or(sdkConfiguration::retryConfig)
+ .orElse(RetryConfig.builder().backoff(BackoffStrategy.builder()
+ .initialInterval(200, TimeUnit.MILLISECONDS)
+ .maxInterval(200, TimeUnit.MILLISECONDS)
+ .baseFactor((double) (1))
+ .maxElapsedTime(1000, TimeUnit.MILLISECONDS)
+ .retryConnectError(true)
+ .build())
+ .build());
+ this.client = this.sdkConfiguration.client();
+ this.operationGlobals = new Globals();
+ this.sdkConfiguration.globals.getParam("header", "x-gr4vy-merchant-account-id")
+ .ifPresent(param -> operationGlobals.putParam("header", "x-gr4vy-merchant-account-id", param));
+ }
+
+ Optional securitySource() {
+ return Optional.ofNullable(this.securitySource);
+ }
+
+ BeforeRequestContextImpl createBeforeRequestContext() {
+ return new BeforeRequestContextImpl(
+ this.sdkConfiguration,
+ this.baseUrl,
+ "list_transaction_actions",
+ java.util.Optional.empty(),
+ securitySource());
+ }
+
+ AfterSuccessContextImpl createAfterSuccessContext() {
+ return new AfterSuccessContextImpl(
+ this.sdkConfiguration,
+ this.baseUrl,
+ "list_transaction_actions",
+ java.util.Optional.empty(),
+ securitySource());
+ }
+
+ AfterErrorContextImpl createAfterErrorContext() {
+ return new AfterErrorContextImpl(
+ this.sdkConfiguration,
+ this.baseUrl,
+ "list_transaction_actions",
+ java.util.Optional.empty(),
+ securitySource());
+ }
+ HttpRequest buildRequest(T request, Class klass) throws Exception {
+ String url = Utils.generateURL(
+ klass,
+ this.baseUrl,
+ "/transactions/{transaction_id}/actions",
+ request, this.operationGlobals);
+ HTTPRequest req = new HTTPRequest(url, "GET");
+ req.addHeader("Accept", "application/json")
+ .addHeader("user-agent", SDKConfiguration.USER_AGENT);
+ _headers.forEach((k, list) -> list.forEach(v -> req.addHeader(k, v)));
+ req.addHeaders(Utils.getHeadersFromMetadata(request, this.operationGlobals));
+ Utils.configureSecurity(req, this.sdkConfiguration.securitySource().getSecurity());
+
+ return req.build();
+ }
+ }
+
+ public static class Sync extends Base
+ implements RequestOperation {
+ public Sync(
+ SDKConfiguration sdkConfiguration, Optional options,
+ Headers _headers) {
+ super(
+ sdkConfiguration, options,
+ _headers);
+ }
+
+ private HttpRequest onBuildRequest(ListTransactionActionsRequest request) throws Exception {
+ HttpRequest req = buildRequest(request, ListTransactionActionsRequest.class);
+ return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req);
+ }
+
+ private HttpResponse onError(HttpResponse response, Exception error) throws Exception {
+ return sdkConfiguration.hooks().afterError(
+ createAfterErrorContext(),
+ Optional.ofNullable(response),
+ Optional.ofNullable(error));
+ }
+
+ private HttpResponse onSuccess(HttpResponse response) throws Exception {
+ return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response);
+ }
+
+ @Override
+ public HttpResponse doRequest(ListTransactionActionsRequest request) {
+ Retries retries = Retries.builder()
+ .action(() -> {
+ HttpRequest r;
+ try {
+ r = onBuildRequest(request);
+ } catch (Exception e) {
+ throw new NonRetryableException(e);
+ }
+ try {
+ HttpResponse httpRes = client.send(r);
+ if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "403", "404", "405", "409", "422", "425", "429", "4XX", "500", "502", "504", "5XX")) {
+ return onError(httpRes, null);
+ }
+ return httpRes;
+ } catch (Exception e) {
+ return onError(null, e);
+ }
+ })
+ .retryConfig(retryConfig)
+ .statusCodes(retryStatusCodes)
+ .build();
+ return unchecked(() -> onSuccess(retries.run())).get();
+ }
+
+
+ @Override
+ public ListTransactionActionsResponse handleResponse(HttpResponse response) {
+ String contentType = response
+ .headers()
+ .firstValue("Content-Type")
+ .orElse("application/octet-stream");
+ ListTransactionActionsResponse.Builder resBuilder =
+ ListTransactionActionsResponse
+ .builder()
+ .contentType(contentType)
+ .statusCode(response.statusCode())
+ .rawResponse(response);
+
+ ListTransactionActionsResponse res = resBuilder.build();
+
+ if (Utils.statusCodeMatches(response.statusCode(), "200")) {
+ if (Utils.contentTypeMatches(contentType, "application/json")) {
+ return res.withTransactionActions(Utils.unmarshal(response, new TypeReference() {}));
+ } else {
+ throw APIException.from("Unexpected content-type received: " + contentType, response);
+ }
+ }
+ if (Utils.statusCodeMatches(response.statusCode(), "400")) {
+ if (Utils.contentTypeMatches(contentType, "application/json")) {
+ throw Error400.from(response);
+ } else {
+ throw APIException.from("Unexpected content-type received: " + contentType, response);
+ }
+ }
+ if (Utils.statusCodeMatches(response.statusCode(), "401")) {
+ if (Utils.contentTypeMatches(contentType, "application/json")) {
+ throw Error401.from(response);
+ } else {
+ throw APIException.from("Unexpected content-type received: " + contentType, response);
+ }
+ }
+ if (Utils.statusCodeMatches(response.statusCode(), "403")) {
+ if (Utils.contentTypeMatches(contentType, "application/json")) {
+ throw Error403.from(response);
+ } else {
+ throw APIException.from("Unexpected content-type received: " + contentType, response);
+ }
+ }
+ if (Utils.statusCodeMatches(response.statusCode(), "404")) {
+ if (Utils.contentTypeMatches(contentType, "application/json")) {
+ throw Error404.from(response);
+ } else {
+ throw APIException.from("Unexpected content-type received: " + contentType, response);
+ }
+ }
+ if (Utils.statusCodeMatches(response.statusCode(), "405")) {
+ if (Utils.contentTypeMatches(contentType, "application/json")) {
+ throw Error405.from(response);
+ } else {
+ throw APIException.from("Unexpected content-type received: " + contentType, response);
+ }
+ }
+ if (Utils.statusCodeMatches(response.statusCode(), "409")) {
+ if (Utils.contentTypeMatches(contentType, "application/json")) {
+ throw Error409.from(response);
+ } else {
+ throw APIException.from("Unexpected content-type received: " + contentType, response);
+ }
+ }
+ if (Utils.statusCodeMatches(response.statusCode(), "422")) {
+ if (Utils.contentTypeMatches(contentType, "application/json")) {
+ throw HTTPValidationError.from(response);
+ } else {
+ throw APIException.from("Unexpected content-type received: " + contentType, response);
+ }
+ }
+ if (Utils.statusCodeMatches(response.statusCode(), "425")) {
+ if (Utils.contentTypeMatches(contentType, "application/json")) {
+ throw Error425.from(response);
+ } else {
+ throw APIException.from("Unexpected content-type received: " + contentType, response);
+ }
+ }
+ if (Utils.statusCodeMatches(response.statusCode(), "429")) {
+ if (Utils.contentTypeMatches(contentType, "application/json")) {
+ throw Error429.from(response);
+ } else {
+ throw APIException.from("Unexpected content-type received: " + contentType, response);
+ }
+ }
+ if (Utils.statusCodeMatches(response.statusCode(), "500")) {
+ if (Utils.contentTypeMatches(contentType, "application/json")) {
+ throw Error500.from(response);
+ } else {
+ throw APIException.from("Unexpected content-type received: " + contentType, response);
+ }
+ }
+ if (Utils.statusCodeMatches(response.statusCode(), "502")) {
+ if (Utils.contentTypeMatches(contentType, "application/json")) {
+ throw Error502.from(response);
+ } else {
+ throw APIException.from("Unexpected content-type received: " + contentType, response);
+ }
+ }
+ if (Utils.statusCodeMatches(response.statusCode(), "504")) {
+ if (Utils.contentTypeMatches(contentType, "application/json")) {
+ throw Error504.from(response);
+ } else {
+ throw APIException.from("Unexpected content-type received: " + contentType, response);
+ }
+ }
+ if (Utils.statusCodeMatches(response.statusCode(), "4XX")) {
+ // no content
+ throw APIException.from("API error occurred", response);
+ }
+ if (Utils.statusCodeMatches(response.statusCode(), "5XX")) {
+ // no content
+ throw APIException.from("API error occurred", response);
+ }
+ throw APIException.from("Unexpected status code received: " + response.statusCode(), response);
+ }
+ }
+ public static class Async extends Base
+ implements AsyncRequestOperation {
+ private final ScheduledExecutorService retryScheduler;
+
+ public Async(
+ SDKConfiguration sdkConfiguration, Optional options,
+ ScheduledExecutorService retryScheduler, Headers _headers) {
+ super(
+ sdkConfiguration, options,
+ _headers);
+ this.retryScheduler = retryScheduler;
+ }
+
+ private CompletableFuture onBuildRequest(ListTransactionActionsRequest request) throws Exception {
+ HttpRequest req = buildRequest(request, ListTransactionActionsRequest.class);
+ return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req);
+ }
+
+ private CompletableFuture> onError(HttpResponse response, Throwable error) {
+ return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error);
+ }
+
+ private CompletableFuture> onSuccess(HttpResponse response) {
+ return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response);
+ }
+
+ @Override
+ public CompletableFuture> doRequest(ListTransactionActionsRequest request) {
+ AsyncRetries retries = AsyncRetries.builder()
+ .retryConfig(retryConfig)
+ .statusCodes(retryStatusCodes)
+ .scheduler(retryScheduler)
+ .build();
+ return retries.retry(() -> unchecked(() -> onBuildRequest(request)).get().thenCompose(client::sendAsync)
+ .handle((resp, err) -> {
+ if (err != null) {
+ return onError(null, err);
+ }
+ if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "403", "404", "405", "409", "422", "425", "429", "4XX", "500", "502", "504", "5XX")) {
+ return onError(resp, null);
+ }
+ return CompletableFuture.completedFuture(resp);
+ })
+ .thenCompose(Function.identity()))
+ .thenCompose(this::onSuccess);
+ }
+
+ @Override
+ public CompletableFuture handleResponse(
+ HttpResponse response) {
+ String contentType = response
+ .headers()
+ .firstValue("Content-Type")
+ .orElse("application/octet-stream");
+ com.gr4vy.sdk.models.operations.async.ListTransactionActionsResponse.Builder resBuilder =
+ com.gr4vy.sdk.models.operations.async.ListTransactionActionsResponse
+ .builder()
+ .contentType(contentType)
+ .statusCode(response.statusCode())
+ .rawResponse(response);
+
+ com.gr4vy.sdk.models.operations.async.ListTransactionActionsResponse res = resBuilder.build();
+
+ if (Utils.statusCodeMatches(response.statusCode(), "200")) {
+ if (Utils.contentTypeMatches(contentType, "application/json")) {
+ return Utils.unmarshalAsync(response, new TypeReference() {})
+ .thenApply(res::withTransactionActions);
+ } else {
+ return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType);
+ }
+ }
+ if (Utils.statusCodeMatches(response.statusCode(), "400")) {
+ if (Utils.contentTypeMatches(contentType, "application/json")) {
+ return Error400.fromAsync(response)
+ .thenCompose(CompletableFuture::failedFuture);
+ } else {
+ return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType);
+ }
+ }
+ if (Utils.statusCodeMatches(response.statusCode(), "401")) {
+ if (Utils.contentTypeMatches(contentType, "application/json")) {
+ return Error401.fromAsync(response)
+ .thenCompose(CompletableFuture::failedFuture);
+ } else {
+ return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType);
+ }
+ }
+ if (Utils.statusCodeMatches(response.statusCode(), "403")) {
+ if (Utils.contentTypeMatches(contentType, "application/json")) {
+ return Error403.fromAsync(response)
+ .thenCompose(CompletableFuture::failedFuture);
+ } else {
+ return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType);
+ }
+ }
+ if (Utils.statusCodeMatches(response.statusCode(), "404")) {
+ if (Utils.contentTypeMatches(contentType, "application/json")) {
+ return Error404.fromAsync(response)
+ .thenCompose(CompletableFuture::failedFuture);
+ } else {
+ return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType);
+ }
+ }
+ if (Utils.statusCodeMatches(response.statusCode(), "405")) {
+ if (Utils.contentTypeMatches(contentType, "application/json")) {
+ return Error405.fromAsync(response)
+ .thenCompose(CompletableFuture::failedFuture);
+ } else {
+ return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType);
+ }
+ }
+ if (Utils.statusCodeMatches(response.statusCode(), "409")) {
+ if (Utils.contentTypeMatches(contentType, "application/json")) {
+ return Error409.fromAsync(response)
+ .thenCompose(CompletableFuture::failedFuture);
+ } else {
+ return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType);
+ }
+ }
+ if (Utils.statusCodeMatches(response.statusCode(), "422")) {
+ if (Utils.contentTypeMatches(contentType, "application/json")) {
+ return HTTPValidationError.fromAsync(response)
+ .thenCompose(CompletableFuture::failedFuture);
+ } else {
+ return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType);
+ }
+ }
+ if (Utils.statusCodeMatches(response.statusCode(), "425")) {
+ if (Utils.contentTypeMatches(contentType, "application/json")) {
+ return Error425.fromAsync(response)
+ .thenCompose(CompletableFuture::failedFuture);
+ } else {
+ return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType);
+ }
+ }
+ if (Utils.statusCodeMatches(response.statusCode(), "429")) {
+ if (Utils.contentTypeMatches(contentType, "application/json")) {
+ return Error429.fromAsync(response)
+ .thenCompose(CompletableFuture::failedFuture);
+ } else {
+ return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType);
+ }
+ }
+ if (Utils.statusCodeMatches(response.statusCode(), "500")) {
+ if (Utils.contentTypeMatches(contentType, "application/json")) {
+ return Error500.fromAsync(response)
+ .thenCompose(CompletableFuture::failedFuture);
+ } else {
+ return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType);
+ }
+ }
+ if (Utils.statusCodeMatches(response.statusCode(), "502")) {
+ if (Utils.contentTypeMatches(contentType, "application/json")) {
+ return Error502.fromAsync(response)
+ .thenCompose(CompletableFuture::failedFuture);
+ } else {
+ return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType);
+ }
+ }
+ if (Utils.statusCodeMatches(response.statusCode(), "504")) {
+ if (Utils.contentTypeMatches(contentType, "application/json")) {
+ return Error504.fromAsync(response)
+ .thenCompose(CompletableFuture::failedFuture);
+ } else {
+ return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType);
+ }
+ }
+ if (Utils.statusCodeMatches(response.statusCode(), "4XX")) {
+ // no content
+ return Utils.createAsyncApiError(response, "API error occurred");
+ }
+ if (Utils.statusCodeMatches(response.statusCode(), "5XX")) {
+ // no content
+ return Utils.createAsyncApiError(response, "API error occurred");
+ }
+ return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode());
+ }
+ }
+}