diff --git a/.fern/metadata.json b/.fern/metadata.json
index 866db587..1dc7ebde 100644
--- a/.fern/metadata.json
+++ b/.fern/metadata.json
@@ -1,7 +1,7 @@
{
- "cliVersion": "5.6.0",
+ "cliVersion": "5.50.0",
"generatorName": "fernapi/fern-java-sdk",
- "generatorVersion": "4.10.7",
+ "generatorVersion": "4.11.1",
"generatorConfig": {
"client-class-name": "BaseSchematic",
"generate-unknown-as-json-node": true,
@@ -14,10 +14,10 @@
"implementation redis.clients:jedis:5.2.0"
]
},
- "originGitCommit": "1e5d567c7baf29c75ed5e08c9dd30b7e83de8e27",
+ "originGitCommit": "19cafdf92ab056ef6ba803bf1e352b0422a8ec45",
"originGitCommitIsDirty": false,
"invokedBy": "ci",
- "requestedVersion": "1.5.0",
+ "requestedVersion": "1.5.1",
"ciProvider": "github",
- "sdkVersion": "1.5.0"
+ "sdkVersion": "1.5.1"
}
\ No newline at end of file
diff --git a/.fern/replay.lock b/.fern/replay.lock
index 68eff774..425912e1 100644
--- a/.fern/replay.lock
+++ b/.fern/replay.lock
@@ -6,5 +6,11 @@ generations:
timestamp: 2026-05-25T11:22:32.078Z
cli_version: unknown
generator_versions: {}
-current_generation: 27876f527547fe93937ca0c57e06af8c48b0b3d3
+ - commit_sha: 6f0570857c48dde6c3e66bba48c4846907746994
+ tree_hash: 38132d7692fd17f6d65764e4ecc22ec6f68fcce7
+ timestamp: 2026-07-14T14:55:22.408Z
+ cli_version: unknown
+ generator_versions:
+ fernapi/fern-java-sdk: 4.11.1
+current_generation: 6f0570857c48dde6c3e66bba48c4846907746994
patches: []
diff --git a/build.gradle b/build.gradle
index 5cb80625..aaef1575 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1,9 +1,19 @@
+buildscript {
+ repositories {
+ gradlePluginPortal()
+ }
+ dependencies {
+ if (JavaVersion.current().isJava11Compatible()) {
+ classpath 'cl.franciscosolis:SonatypeCentralUpload:1.0.3'
+ }
+ }
+}
+
plugins {
id 'java-library'
id 'maven-publish'
id 'com.diffplug.spotless' version '6.11.0'
id 'signing'
- id 'cl.franciscosolis.sonatype-central-upload' version '1.0.3'
}
repositories {
@@ -52,7 +62,7 @@ java {
group = 'com.schematichq'
-version = '1.5.0'
+version = '1.5.1'
jar {
dependsOn(":generatePomFileForMavenPublication")
@@ -83,7 +93,7 @@ publishing {
maven(MavenPublication) {
groupId = 'com.schematichq'
artifactId = 'schematic-java'
- version = '1.5.0'
+ version = '1.5.1'
from components.java
pom {
name = 'Schematic'
@@ -110,19 +120,25 @@ publishing {
}
}
-sonatypeCentralUpload {
- username = "$System.env.MAVEN_USERNAME"
- password = "$System.env.MAVEN_PASSWORD"
+if (JavaVersion.current().isJava11Compatible()) {
+ apply plugin: 'cl.franciscosolis.sonatype-central-upload'
- archives = files(
- "$buildDir/libs/schematic-java-" + version + ".jar",
- "$buildDir/libs/schematic-java-" + version + "-sources.jar",
- "$buildDir/libs/schematic-java-" + version + "-javadoc.jar"
- )
+ sonatypeCentralUpload {
+ username = "$System.env.MAVEN_USERNAME"
+ password = "$System.env.MAVEN_PASSWORD"
- pom = file("$buildDir/publications/maven/pom-default.xml")
- signingKey = "$System.env.MAVEN_SIGNATURE_SECRET_KEY"
- signingKeyPassphrase = "$System.env.MAVEN_SIGNATURE_PASSWORD"
+ archives = files(
+ "$buildDir/libs/schematic-java-" + version + ".jar",
+ "$buildDir/libs/schematic-java-" + version + "-sources.jar",
+ "$buildDir/libs/schematic-java-" + version + "-javadoc.jar"
+ )
+
+ pom = file("$buildDir/publications/maven/pom-default.xml")
+ signingKey = "$System.env.MAVEN_SIGNATURE_SECRET_KEY"
+ signingKeyPassphrase = "$System.env.MAVEN_SIGNATURE_PASSWORD"
+ }
+
+ sonatypeCentralUpload.dependsOn build
}
signing {
@@ -132,5 +148,3 @@ signing {
useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword)
sign publishing.publications.maven
}
-
-sonatypeCentralUpload.dependsOn build
diff --git a/reference.md b/reference.md
index a8fb8944..97bae759 100644
--- a/reference.md
+++ b/reference.md
@@ -1844,6 +1844,14 @@ client.billing().upsertInvoice(
-
+**endingBalance:** `Optional`
+
+
+
+
+
+-
+
**externalId:** `Optional`
@@ -1860,6 +1868,14 @@ client.billing().upsertInvoice(
-
+**startingBalance:** `Optional`
+
+
+
+
+
+-
+
**status:** `Optional`
@@ -10858,6 +10874,14 @@ client.entitlements().createPlanEntitlement(
-
+**warningTiers:** `Optional
>`
+
+
+
+
+
+-
+
**yearlyMeteredPriceId:** `Optional`
@@ -11184,6 +11208,14 @@ client.entitlements().updatePlanEntitlement(
-
+**warningTiers:** `Optional
>`
+
+
+
+
+
+-
+
**yearlyMeteredPriceId:** `Optional`
@@ -11545,6 +11577,14 @@ client.entitlements().upsertPlanEntitlementForBillingProduct(
-
+**warningTiers:** `Optional
>`
+
+
+
+
+
+-
+
**yearlyMeteredPriceId:** `Optional`
@@ -13799,14 +13839,6 @@ client.planbundle().createPlanBundle(
**plan:** `Optional`
-
-
-
-
--
-
-**traits:** `Optional
>`
-
@@ -13900,14 +13932,6 @@ client.planbundle().updatePlanBundle(
**planVersionId:** `Optional`
-
-
-
-
--
-
-**traits:** `Optional
>`
-
diff --git a/src/main/java/com/schematic/api/AsyncRawBaseSchematic.java b/src/main/java/com/schematic/api/AsyncRawBaseSchematic.java
index 6d926ed2..35685983 100644
--- a/src/main/java/com/schematic/api/AsyncRawBaseSchematic.java
+++ b/src/main/java/com/schematic/api/AsyncRawBaseSchematic.java
@@ -3,12 +3,14 @@
*/
package com.schematic.api;
+import com.fasterxml.jackson.core.JsonProcessingException;
import com.schematic.api.core.BaseSchematicApiException;
import com.schematic.api.core.BaseSchematicException;
import com.schematic.api.core.BaseSchematicHttpResponse;
import com.schematic.api.core.ClientOptions;
import com.schematic.api.core.ObjectMappers;
import com.schematic.api.core.RequestOptions;
+import com.schematic.api.core.RetryInterceptor;
import java.io.IOException;
import java.util.concurrent.CompletableFuture;
import okhttp3.Call;
@@ -50,6 +52,15 @@ public CompletableFuture> getCreditLedger(Reques
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
CompletableFuture> future = new CompletableFuture<>();
client.newCall(okhttpRequest).enqueue(new Callback() {
@Override
@@ -64,6 +75,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO
future.completeExceptionally(new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response));
return;
+ } catch (JsonProcessingException e) {
+ future.completeExceptionally(
+ new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e));
} catch (IOException e) {
future.completeExceptionally(new BaseSchematicException("Network error executing HTTP request", e));
}
diff --git a/src/main/java/com/schematic/api/RawBaseSchematic.java b/src/main/java/com/schematic/api/RawBaseSchematic.java
index 9f77bf36..4bdf2c2f 100644
--- a/src/main/java/com/schematic/api/RawBaseSchematic.java
+++ b/src/main/java/com/schematic/api/RawBaseSchematic.java
@@ -3,12 +3,14 @@
*/
package com.schematic.api;
+import com.fasterxml.jackson.core.JsonProcessingException;
import com.schematic.api.core.BaseSchematicApiException;
import com.schematic.api.core.BaseSchematicException;
import com.schematic.api.core.BaseSchematicHttpResponse;
import com.schematic.api.core.ClientOptions;
import com.schematic.api.core.ObjectMappers;
import com.schematic.api.core.RequestOptions;
+import com.schematic.api.core.RetryInterceptor;
import java.io.IOException;
import okhttp3.Headers;
import okhttp3.HttpUrl;
@@ -46,6 +48,15 @@ public BaseSchematicHttpResponse getCreditLedger(RequestOptions requestOpt
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
try (Response response = client.newCall(okhttpRequest).execute()) {
ResponseBody responseBody = response.body();
if (response.isSuccessful()) {
@@ -55,6 +66,8 @@ public BaseSchematicHttpResponse getCreditLedger(RequestOptions requestOpt
Object errorBody = ObjectMappers.parseErrorBody(responseBodyString);
throw new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response);
+ } catch (JsonProcessingException e) {
+ throw new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e);
} catch (IOException e) {
throw new BaseSchematicException("Network error executing HTTP request", e);
}
diff --git a/src/main/java/com/schematic/api/core/ClientOptions.java b/src/main/java/com/schematic/api/core/ClientOptions.java
index 59fa6ca7..15e79315 100644
--- a/src/main/java/com/schematic/api/core/ClientOptions.java
+++ b/src/main/java/com/schematic/api/core/ClientOptions.java
@@ -38,10 +38,10 @@ private ClientOptions(
this.headers.putAll(headers);
this.headers.putAll(new HashMap() {
{
- put("User-Agent", "com.schematichq:schematic-java/1.5.0");
+ put("User-Agent", "com.schematichq:schematic-java/1.5.1");
put("X-Fern-Language", "JAVA");
put("X-Fern-SDK-Name", "com.schematic.fern:api-sdk");
- put("X-Fern-SDK-Version", "1.5.0");
+ put("X-Fern-SDK-Version", "1.5.1");
}
});
this.headerSuppliers = headerSuppliers;
diff --git a/src/main/java/com/schematic/api/core/DateTimeDeserializer.java b/src/main/java/com/schematic/api/core/DateTimeDeserializer.java
index c60a3a44..833169fb 100644
--- a/src/main/java/com/schematic/api/core/DateTimeDeserializer.java
+++ b/src/main/java/com/schematic/api/core/DateTimeDeserializer.java
@@ -19,7 +19,8 @@
import java.time.temporal.TemporalQueries;
/**
- * Custom deserializer that handles converting ISO8601 dates into {@link OffsetDateTime} objects.
+ * Custom deserializer that handles converting date-time strings into {@link OffsetDateTime} objects.
+ * Supports ISO 8601 format, space-separated variants, and RFC 1123 (RFC 2822) format.
*/
class DateTimeDeserializer extends JsonDeserializer {
private static final SimpleModule MODULE;
@@ -48,9 +49,15 @@ public OffsetDateTime deserialize(JsonParser parser, DeserializationContext cont
try {
temporal = DateTimeFormatter.ISO_DATE_TIME.parseBest(value, OffsetDateTime::from, LocalDateTime::from);
} catch (DateTimeParseException e) {
- // Fall back to space-separated format (e.g. "2025-02-15 10:30:00+00:00").
- temporal = DateTimeFormatter.ISO_DATE_TIME.parseBest(
- value.replace(' ', 'T'), OffsetDateTime::from, LocalDateTime::from);
+ try {
+ // Fall back to space-separated format (e.g. "2025-02-15 10:30:00+00:00").
+ temporal = DateTimeFormatter.ISO_DATE_TIME.parseBest(
+ value.replace(' ', 'T'), OffsetDateTime::from, LocalDateTime::from);
+ } catch (DateTimeParseException e2) {
+ // Fall back to RFC 1123 format (e.g. "Thu, 07 May 2026 14:23:38 +0000").
+ temporal = DateTimeFormatter.RFC_1123_DATE_TIME.parseBest(
+ value, OffsetDateTime::from, LocalDateTime::from);
+ }
}
if (temporal.query(TemporalQueries.offset()) == null) {
diff --git a/src/main/java/com/schematic/api/core/RequestOptions.java b/src/main/java/com/schematic/api/core/RequestOptions.java
index 7249e3c1..7b5afb39 100644
--- a/src/main/java/com/schematic/api/core/RequestOptions.java
+++ b/src/main/java/com/schematic/api/core/RequestOptions.java
@@ -16,6 +16,8 @@ public final class RequestOptions {
private final TimeUnit timeoutTimeUnit;
+ private final Optional maxRetries;
+
private final Map headers;
private final Map> headerSuppliers;
@@ -28,6 +30,7 @@ private RequestOptions(
String apiKey,
Optional timeout,
TimeUnit timeoutTimeUnit,
+ Optional maxRetries,
Map headers,
Map> headerSuppliers,
Map queryParameters,
@@ -35,6 +38,7 @@ private RequestOptions(
this.apiKey = apiKey;
this.timeout = timeout;
this.timeoutTimeUnit = timeoutTimeUnit;
+ this.maxRetries = maxRetries;
this.headers = headers;
this.headerSuppliers = headerSuppliers;
this.queryParameters = queryParameters;
@@ -49,6 +53,10 @@ public TimeUnit getTimeoutTimeUnit() {
return timeoutTimeUnit;
}
+ public Optional getMaxRetries() {
+ return maxRetries;
+ }
+
public Map getHeaders() {
Map headers = new HashMap<>();
if (this.apiKey != null) {
@@ -80,6 +88,8 @@ public static class Builder {
private TimeUnit timeoutTimeUnit = TimeUnit.SECONDS;
+ private Optional maxRetries = Optional.empty();
+
private final Map headers = new HashMap<>();
private final Map> headerSuppliers = new HashMap<>();
@@ -104,6 +114,11 @@ public Builder timeout(Integer timeout, TimeUnit timeoutTimeUnit) {
return this;
}
+ public Builder maxRetries(Integer maxRetries) {
+ this.maxRetries = Optional.of(maxRetries);
+ return this;
+ }
+
public Builder addHeader(String key, String value) {
this.headers.put(key, value);
return this;
@@ -129,6 +144,7 @@ public RequestOptions build() {
apiKey,
timeout,
timeoutTimeUnit,
+ maxRetries,
headers,
headerSuppliers,
queryParameters,
diff --git a/src/main/java/com/schematic/api/core/RetryInterceptor.java b/src/main/java/com/schematic/api/core/RetryInterceptor.java
index 5493606e..de9aa090 100644
--- a/src/main/java/com/schematic/api/core/RetryInterceptor.java
+++ b/src/main/java/com/schematic/api/core/RetryInterceptor.java
@@ -11,6 +11,7 @@
import java.util.Optional;
import java.util.Random;
import okhttp3.Interceptor;
+import okhttp3.Request;
import okhttp3.Response;
public class RetryInterceptor implements Interceptor {
@@ -28,17 +29,24 @@ public RetryInterceptor(int maxRetries) {
@Override
public Response intercept(Chain chain) throws IOException {
- Response response = chain.proceed(chain.request());
+ Request request = chain.request();
+ int effectiveMaxRetries = resolveMaxRetries(request);
+ Response response = chain.proceed(request);
if (shouldRetry(response.code())) {
- return retryChain(response, chain);
+ return retryChain(response, chain, effectiveMaxRetries);
}
return response;
}
- private Response retryChain(Response response, Chain chain) throws IOException {
- ExponentialBackoff backoff = new ExponentialBackoff(this.maxRetries);
+ private int resolveMaxRetries(Request request) {
+ MaxRetriesOverride override = request.tag(MaxRetriesOverride.class);
+ return override != null ? override.getValue() : this.maxRetries;
+ }
+
+ private Response retryChain(Response response, Chain chain, int maxRetries) throws IOException {
+ ExponentialBackoff backoff = new ExponentialBackoff(maxRetries);
Optional nextBackoff = backoff.nextBackoff(response);
while (nextBackoff.isPresent()) {
try {
@@ -158,6 +166,23 @@ private static boolean shouldRetry(int statusCode) {
return statusCode == 408 || statusCode == 429 || statusCode >= 500;
}
+ /**
+ * Per-request override carried on the OkHttp {@link Request} as a tag.
+ * When present, the interceptor uses this value instead of the client-wide
+ * {@code maxRetries} configured at construction time.
+ */
+ public static final class MaxRetriesOverride {
+ private final int value;
+
+ public MaxRetriesOverride(int value) {
+ this.value = value;
+ }
+
+ public int getValue() {
+ return value;
+ }
+ }
+
private final class ExponentialBackoff {
private final int maxNumRetries;
diff --git a/src/main/java/com/schematic/api/resources/accesstokens/AsyncRawAccesstokensClient.java b/src/main/java/com/schematic/api/resources/accesstokens/AsyncRawAccesstokensClient.java
index 66c03805..7da5465d 100644
--- a/src/main/java/com/schematic/api/resources/accesstokens/AsyncRawAccesstokensClient.java
+++ b/src/main/java/com/schematic/api/resources/accesstokens/AsyncRawAccesstokensClient.java
@@ -11,6 +11,7 @@
import com.schematic.api.core.MediaTypes;
import com.schematic.api.core.ObjectMappers;
import com.schematic.api.core.RequestOptions;
+import com.schematic.api.core.RetryInterceptor;
import com.schematic.api.errors.BadRequestError;
import com.schematic.api.errors.ForbiddenError;
import com.schematic.api.errors.InternalServerError;
@@ -72,6 +73,15 @@ public CompletableFuture> future =
new CompletableFuture<>();
client.newCall(okhttpRequest).enqueue(new Callback() {
@@ -121,6 +131,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO
future.completeExceptionally(new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response));
return;
+ } catch (JsonProcessingException e) {
+ future.completeExceptionally(
+ new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e));
} catch (IOException e) {
future.completeExceptionally(new BaseSchematicException("Network error executing HTTP request", e));
}
diff --git a/src/main/java/com/schematic/api/resources/accesstokens/RawAccesstokensClient.java b/src/main/java/com/schematic/api/resources/accesstokens/RawAccesstokensClient.java
index 039327bf..6a8a1faa 100644
--- a/src/main/java/com/schematic/api/resources/accesstokens/RawAccesstokensClient.java
+++ b/src/main/java/com/schematic/api/resources/accesstokens/RawAccesstokensClient.java
@@ -11,6 +11,7 @@
import com.schematic.api.core.MediaTypes;
import com.schematic.api.core.ObjectMappers;
import com.schematic.api.core.RequestOptions;
+import com.schematic.api.core.RetryInterceptor;
import com.schematic.api.errors.BadRequestError;
import com.schematic.api.errors.ForbiddenError;
import com.schematic.api.errors.InternalServerError;
@@ -68,6 +69,15 @@ public BaseSchematicHttpResponse issueTempora
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
try (Response response = client.newCall(okhttpRequest).execute()) {
ResponseBody responseBody = response.body();
String responseBodyString = responseBody != null ? responseBody.string() : "{}";
@@ -101,6 +111,8 @@ public BaseSchematicHttpResponse issueTempora
Object errorBody = ObjectMappers.parseErrorBody(responseBodyString);
throw new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response);
+ } catch (JsonProcessingException e) {
+ throw new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e);
} catch (IOException e) {
throw new BaseSchematicException("Network error executing HTTP request", e);
}
diff --git a/src/main/java/com/schematic/api/resources/accounts/AsyncRawAccountsClient.java b/src/main/java/com/schematic/api/resources/accounts/AsyncRawAccountsClient.java
index 74be6fee..1fc9b4d9 100644
--- a/src/main/java/com/schematic/api/resources/accounts/AsyncRawAccountsClient.java
+++ b/src/main/java/com/schematic/api/resources/accounts/AsyncRawAccountsClient.java
@@ -12,6 +12,7 @@
import com.schematic.api.core.ObjectMappers;
import com.schematic.api.core.QueryStringMapper;
import com.schematic.api.core.RequestOptions;
+import com.schematic.api.core.RetryInterceptor;
import com.schematic.api.errors.BadRequestError;
import com.schematic.api.errors.ForbiddenError;
import com.schematic.api.errors.InternalServerError;
@@ -116,6 +117,15 @@ public CompletableFuture>
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
CompletableFuture> future = new CompletableFuture<>();
client.newCall(okhttpRequest).enqueue(new Callback() {
@Override
@@ -164,6 +174,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO
future.completeExceptionally(new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response));
return;
+ } catch (JsonProcessingException e) {
+ future.completeExceptionally(
+ new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e));
} catch (IOException e) {
future.completeExceptionally(new BaseSchematicException("Network error executing HTTP request", e));
}
@@ -203,6 +216,15 @@ public CompletableFuture> ge
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
CompletableFuture> future = new CompletableFuture<>();
client.newCall(okhttpRequest).enqueue(new Callback() {
@Override
@@ -245,6 +267,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO
future.completeExceptionally(new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response));
return;
+ } catch (JsonProcessingException e) {
+ future.completeExceptionally(
+ new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e));
} catch (IOException e) {
future.completeExceptionally(new BaseSchematicException("Network error executing HTTP request", e));
}
@@ -306,6 +331,15 @@ public CompletableFuture>
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
CompletableFuture> future = new CompletableFuture<>();
client.newCall(okhttpRequest).enqueue(new Callback() {
@Override
@@ -354,6 +388,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO
future.completeExceptionally(new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response));
return;
+ } catch (JsonProcessingException e) {
+ future.completeExceptionally(
+ new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e));
} catch (IOException e) {
future.completeExceptionally(new BaseSchematicException("Network error executing HTTP request", e));
}
@@ -404,6 +441,15 @@ public CompletableFuture> listApi
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
CompletableFuture> future = new CompletableFuture<>();
client.newCall(okhttpRequest).enqueue(new Callback() {
@Override
@@ -451,6 +497,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO
future.completeExceptionally(new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response));
return;
+ } catch (JsonProcessingException e) {
+ future.completeExceptionally(
+ new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e));
} catch (IOException e) {
future.completeExceptionally(new BaseSchematicException("Network error executing HTTP request", e));
}
@@ -497,6 +546,15 @@ public CompletableFuture> create
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
CompletableFuture> future = new CompletableFuture<>();
client.newCall(okhttpRequest).enqueue(new Callback() {
@Override
@@ -544,6 +602,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO
future.completeExceptionally(new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response));
return;
+ } catch (JsonProcessingException e) {
+ future.completeExceptionally(
+ new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e));
} catch (IOException e) {
future.completeExceptionally(new BaseSchematicException("Network error executing HTTP request", e));
}
@@ -582,6 +643,15 @@ public CompletableFuture> getApiKey
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
CompletableFuture> future = new CompletableFuture<>();
client.newCall(okhttpRequest).enqueue(new Callback() {
@Override
@@ -624,6 +694,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO
future.completeExceptionally(new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response));
return;
+ } catch (JsonProcessingException e) {
+ future.completeExceptionally(
+ new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e));
} catch (IOException e) {
future.completeExceptionally(new BaseSchematicException("Network error executing HTTP request", e));
}
@@ -680,6 +753,15 @@ public CompletableFuture> update
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
CompletableFuture> future = new CompletableFuture<>();
client.newCall(okhttpRequest).enqueue(new Callback() {
@Override
@@ -727,6 +809,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO
future.completeExceptionally(new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response));
return;
+ } catch (JsonProcessingException e) {
+ future.completeExceptionally(
+ new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e));
} catch (IOException e) {
future.completeExceptionally(new BaseSchematicException("Network error executing HTTP request", e));
}
@@ -765,6 +850,15 @@ public CompletableFuture> delete
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
CompletableFuture> future = new CompletableFuture<>();
client.newCall(okhttpRequest).enqueue(new Callback() {
@Override
@@ -812,6 +906,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO
future.completeExceptionally(new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response));
return;
+ } catch (JsonProcessingException e) {
+ future.completeExceptionally(
+ new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e));
} catch (IOException e) {
future.completeExceptionally(new BaseSchematicException("Network error executing HTTP request", e));
}
@@ -863,6 +960,15 @@ public CompletableFuture> countA
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
CompletableFuture> future = new CompletableFuture<>();
client.newCall(okhttpRequest).enqueue(new Callback() {
@Override
@@ -910,6 +1016,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO
future.completeExceptionally(new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response));
return;
+ } catch (JsonProcessingException e) {
+ future.completeExceptionally(
+ new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e));
} catch (IOException e) {
future.completeExceptionally(new BaseSchematicException("Network error executing HTTP request", e));
}
@@ -984,6 +1093,15 @@ public CompletableFuture> listA
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
CompletableFuture> future = new CompletableFuture<>();
client.newCall(okhttpRequest).enqueue(new Callback() {
@Override
@@ -1031,6 +1149,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO
future.completeExceptionally(new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response));
return;
+ } catch (JsonProcessingException e) {
+ future.completeExceptionally(
+ new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e));
} catch (IOException e) {
future.completeExceptionally(new BaseSchematicException("Network error executing HTTP request", e));
}
@@ -1069,6 +1190,15 @@ public CompletableFuture> getAudi
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
CompletableFuture> future = new CompletableFuture<>();
client.newCall(okhttpRequest).enqueue(new Callback() {
@Override
@@ -1111,6 +1241,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO
future.completeExceptionally(new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response));
return;
+ } catch (JsonProcessingException e) {
+ future.completeExceptionally(
+ new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e));
} catch (IOException e) {
future.completeExceptionally(new BaseSchematicException("Network error executing HTTP request", e));
}
@@ -1185,6 +1318,15 @@ public CompletableFuture> coun
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
CompletableFuture> future = new CompletableFuture<>();
client.newCall(okhttpRequest).enqueue(new Callback() {
@Override
@@ -1232,6 +1374,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO
future.completeExceptionally(new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response));
return;
+ } catch (JsonProcessingException e) {
+ future.completeExceptionally(
+ new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e));
} catch (IOException e) {
future.completeExceptionally(new BaseSchematicException("Network error executing HTTP request", e));
}
@@ -1290,6 +1435,15 @@ public CompletableFuture> li
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
CompletableFuture> future = new CompletableFuture<>();
client.newCall(okhttpRequest).enqueue(new Callback() {
@Override
@@ -1337,6 +1491,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO
future.completeExceptionally(new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response));
return;
+ } catch (JsonProcessingException e) {
+ future.completeExceptionally(
+ new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e));
} catch (IOException e) {
future.completeExceptionally(new BaseSchematicException("Network error executing HTTP request", e));
}
@@ -1383,6 +1540,15 @@ public CompletableFuture> c
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
CompletableFuture> future = new CompletableFuture<>();
client.newCall(okhttpRequest).enqueue(new Callback() {
@Override
@@ -1431,6 +1597,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO
future.completeExceptionally(new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response));
return;
+ } catch (JsonProcessingException e) {
+ future.completeExceptionally(
+ new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e));
} catch (IOException e) {
future.completeExceptionally(new BaseSchematicException("Network error executing HTTP request", e));
}
@@ -1469,6 +1638,15 @@ public CompletableFuture> getE
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
CompletableFuture> future = new CompletableFuture<>();
client.newCall(okhttpRequest).enqueue(new Callback() {
@Override
@@ -1511,6 +1689,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO
future.completeExceptionally(new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response));
return;
+ } catch (JsonProcessingException e) {
+ future.completeExceptionally(
+ new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e));
} catch (IOException e) {
future.completeExceptionally(new BaseSchematicException("Network error executing HTTP request", e));
}
@@ -1570,6 +1751,15 @@ public CompletableFuture> u
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
CompletableFuture> future = new CompletableFuture<>();
client.newCall(okhttpRequest).enqueue(new Callback() {
@Override
@@ -1618,6 +1808,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO
future.completeExceptionally(new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response));
return;
+ } catch (JsonProcessingException e) {
+ future.completeExceptionally(
+ new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e));
} catch (IOException e) {
future.completeExceptionally(new BaseSchematicException("Network error executing HTTP request", e));
}
@@ -1657,6 +1850,15 @@ public CompletableFuture> d
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
CompletableFuture> future = new CompletableFuture<>();
client.newCall(okhttpRequest).enqueue(new Callback() {
@Override
@@ -1705,6 +1907,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO
future.completeExceptionally(new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response));
return;
+ } catch (JsonProcessingException e) {
+ future.completeExceptionally(
+ new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e));
} catch (IOException e) {
future.completeExceptionally(new BaseSchematicException("Network error executing HTTP request", e));
}
@@ -1741,6 +1946,15 @@ public CompletableFuture> quicksta
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
CompletableFuture> future = new CompletableFuture<>();
client.newCall(okhttpRequest).enqueue(new Callback() {
@Override
@@ -1788,6 +2002,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO
future.completeExceptionally(new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response));
return;
+ } catch (JsonProcessingException e) {
+ future.completeExceptionally(
+ new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e));
} catch (IOException e) {
future.completeExceptionally(new BaseSchematicException("Network error executing HTTP request", e));
}
@@ -1824,6 +2041,15 @@ public CompletableFuture> getWhoAmI
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
CompletableFuture> future = new CompletableFuture<>();
client.newCall(okhttpRequest).enqueue(new Callback() {
@Override
@@ -1866,6 +2092,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO
future.completeExceptionally(new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response));
return;
+ } catch (JsonProcessingException e) {
+ future.completeExceptionally(
+ new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e));
} catch (IOException e) {
future.completeExceptionally(new BaseSchematicException("Network error executing HTTP request", e));
}
diff --git a/src/main/java/com/schematic/api/resources/accounts/RawAccountsClient.java b/src/main/java/com/schematic/api/resources/accounts/RawAccountsClient.java
index f231db68..b91959d6 100644
--- a/src/main/java/com/schematic/api/resources/accounts/RawAccountsClient.java
+++ b/src/main/java/com/schematic/api/resources/accounts/RawAccountsClient.java
@@ -12,6 +12,7 @@
import com.schematic.api.core.ObjectMappers;
import com.schematic.api.core.QueryStringMapper;
import com.schematic.api.core.RequestOptions;
+import com.schematic.api.core.RetryInterceptor;
import com.schematic.api.errors.BadRequestError;
import com.schematic.api.errors.ForbiddenError;
import com.schematic.api.errors.InternalServerError;
@@ -110,6 +111,15 @@ public BaseSchematicHttpResponse listAccountMembers(
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
try (Response response = client.newCall(okhttpRequest).execute()) {
ResponseBody responseBody = response.body();
String responseBodyString = responseBody != null ? responseBody.string() : "{}";
@@ -142,6 +152,8 @@ public BaseSchematicHttpResponse listAccountMembers(
Object errorBody = ObjectMappers.parseErrorBody(responseBodyString);
throw new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response);
+ } catch (JsonProcessingException e) {
+ throw new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e);
} catch (IOException e) {
throw new BaseSchematicException("Network error executing HTTP request", e);
}
@@ -172,6 +184,15 @@ public BaseSchematicHttpResponse getAccountMember(
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
try (Response response = client.newCall(okhttpRequest).execute()) {
ResponseBody responseBody = response.body();
String responseBodyString = responseBody != null ? responseBody.string() : "{}";
@@ -201,6 +222,8 @@ public BaseSchematicHttpResponse getAccountMember(
Object errorBody = ObjectMappers.parseErrorBody(responseBodyString);
throw new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response);
+ } catch (JsonProcessingException e) {
+ throw new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e);
} catch (IOException e) {
throw new BaseSchematicException("Network error executing HTTP request", e);
}
@@ -253,6 +276,15 @@ public BaseSchematicHttpResponse countAccountMember
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
try (Response response = client.newCall(okhttpRequest).execute()) {
ResponseBody responseBody = response.body();
String responseBodyString = responseBody != null ? responseBody.string() : "{}";
@@ -285,6 +317,8 @@ public BaseSchematicHttpResponse countAccountMember
Object errorBody = ObjectMappers.parseErrorBody(responseBodyString);
throw new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response);
+ } catch (JsonProcessingException e) {
+ throw new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e);
} catch (IOException e) {
throw new BaseSchematicException("Network error executing HTTP request", e);
}
@@ -327,6 +361,15 @@ public BaseSchematicHttpResponse listApiKeys(
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
try (Response response = client.newCall(okhttpRequest).execute()) {
ResponseBody responseBody = response.body();
String responseBodyString = responseBody != null ? responseBody.string() : "{}";
@@ -358,6 +401,8 @@ public BaseSchematicHttpResponse listApiKeys(
Object errorBody = ObjectMappers.parseErrorBody(responseBodyString);
throw new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response);
+ } catch (JsonProcessingException e) {
+ throw new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e);
} catch (IOException e) {
throw new BaseSchematicException("Network error executing HTTP request", e);
}
@@ -395,6 +440,15 @@ public BaseSchematicHttpResponse createApiKey(
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
try (Response response = client.newCall(okhttpRequest).execute()) {
ResponseBody responseBody = response.body();
String responseBodyString = responseBody != null ? responseBody.string() : "{}";
@@ -426,6 +480,8 @@ public BaseSchematicHttpResponse createApiKey(
Object errorBody = ObjectMappers.parseErrorBody(responseBodyString);
throw new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response);
+ } catch (JsonProcessingException e) {
+ throw new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e);
} catch (IOException e) {
throw new BaseSchematicException("Network error executing HTTP request", e);
}
@@ -455,6 +511,15 @@ public BaseSchematicHttpResponse getApiKey(String apiKeyId, R
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
try (Response response = client.newCall(okhttpRequest).execute()) {
ResponseBody responseBody = response.body();
String responseBodyString = responseBody != null ? responseBody.string() : "{}";
@@ -483,6 +548,8 @@ public BaseSchematicHttpResponse getApiKey(String apiKeyId, R
Object errorBody = ObjectMappers.parseErrorBody(responseBodyString);
throw new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response);
+ } catch (JsonProcessingException e) {
+ throw new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e);
} catch (IOException e) {
throw new BaseSchematicException("Network error executing HTTP request", e);
}
@@ -531,6 +598,15 @@ public BaseSchematicHttpResponse updateApiKey(
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
try (Response response = client.newCall(okhttpRequest).execute()) {
ResponseBody responseBody = response.body();
String responseBodyString = responseBody != null ? responseBody.string() : "{}";
@@ -562,6 +638,8 @@ public BaseSchematicHttpResponse updateApiKey(
Object errorBody = ObjectMappers.parseErrorBody(responseBodyString);
throw new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response);
+ } catch (JsonProcessingException e) {
+ throw new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e);
} catch (IOException e) {
throw new BaseSchematicException("Network error executing HTTP request", e);
}
@@ -592,6 +670,15 @@ public BaseSchematicHttpResponse deleteApiKey(
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
try (Response response = client.newCall(okhttpRequest).execute()) {
ResponseBody responseBody = response.body();
String responseBodyString = responseBody != null ? responseBody.string() : "{}";
@@ -623,6 +710,8 @@ public BaseSchematicHttpResponse deleteApiKey(
Object errorBody = ObjectMappers.parseErrorBody(responseBodyString);
throw new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response);
+ } catch (JsonProcessingException e) {
+ throw new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e);
} catch (IOException e) {
throw new BaseSchematicException("Network error executing HTTP request", e);
}
@@ -665,6 +754,15 @@ public BaseSchematicHttpResponse countApiKeys(
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
try (Response response = client.newCall(okhttpRequest).execute()) {
ResponseBody responseBody = response.body();
String responseBodyString = responseBody != null ? responseBody.string() : "{}";
@@ -696,6 +794,8 @@ public BaseSchematicHttpResponse countApiKeys(
Object errorBody = ObjectMappers.parseErrorBody(responseBodyString);
throw new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response);
+ } catch (JsonProcessingException e) {
+ throw new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e);
} catch (IOException e) {
throw new BaseSchematicException("Network error executing HTTP request", e);
}
@@ -760,6 +860,15 @@ public BaseSchematicHttpResponse listAuditLogs(
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
try (Response response = client.newCall(okhttpRequest).execute()) {
ResponseBody responseBody = response.body();
String responseBodyString = responseBody != null ? responseBody.string() : "{}";
@@ -791,6 +900,8 @@ public BaseSchematicHttpResponse listAuditLogs(
Object errorBody = ObjectMappers.parseErrorBody(responseBodyString);
throw new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response);
+ } catch (JsonProcessingException e) {
+ throw new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e);
} catch (IOException e) {
throw new BaseSchematicException("Network error executing HTTP request", e);
}
@@ -821,6 +932,15 @@ public BaseSchematicHttpResponse getAuditLog(
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
try (Response response = client.newCall(okhttpRequest).execute()) {
ResponseBody responseBody = response.body();
String responseBodyString = responseBody != null ? responseBody.string() : "{}";
@@ -849,6 +969,8 @@ public BaseSchematicHttpResponse getAuditLog(
Object errorBody = ObjectMappers.parseErrorBody(responseBodyString);
throw new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response);
+ } catch (JsonProcessingException e) {
+ throw new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e);
} catch (IOException e) {
throw new BaseSchematicException("Network error executing HTTP request", e);
}
@@ -913,6 +1035,15 @@ public BaseSchematicHttpResponse countAuditLogs(
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
try (Response response = client.newCall(okhttpRequest).execute()) {
ResponseBody responseBody = response.body();
String responseBodyString = responseBody != null ? responseBody.string() : "{}";
@@ -945,6 +1076,8 @@ public BaseSchematicHttpResponse countAuditLogs(
Object errorBody = ObjectMappers.parseErrorBody(responseBodyString);
throw new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response);
+ } catch (JsonProcessingException e) {
+ throw new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e);
} catch (IOException e) {
throw new BaseSchematicException("Network error executing HTTP request", e);
}
@@ -993,6 +1126,15 @@ public BaseSchematicHttpResponse listEnvironments(
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
try (Response response = client.newCall(okhttpRequest).execute()) {
ResponseBody responseBody = response.body();
String responseBodyString = responseBody != null ? responseBody.string() : "{}";
@@ -1025,6 +1167,8 @@ public BaseSchematicHttpResponse listEnvironments(
Object errorBody = ObjectMappers.parseErrorBody(responseBodyString);
throw new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response);
+ } catch (JsonProcessingException e) {
+ throw new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e);
} catch (IOException e) {
throw new BaseSchematicException("Network error executing HTTP request", e);
}
@@ -1063,6 +1207,15 @@ public BaseSchematicHttpResponse createEnvironment(
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
try (Response response = client.newCall(okhttpRequest).execute()) {
ResponseBody responseBody = response.body();
String responseBodyString = responseBody != null ? responseBody.string() : "{}";
@@ -1095,6 +1248,8 @@ public BaseSchematicHttpResponse createEnvironment(
Object errorBody = ObjectMappers.parseErrorBody(responseBodyString);
throw new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response);
+ } catch (JsonProcessingException e) {
+ throw new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e);
} catch (IOException e) {
throw new BaseSchematicException("Network error executing HTTP request", e);
}
@@ -1125,6 +1280,15 @@ public BaseSchematicHttpResponse getEnvironment(
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
try (Response response = client.newCall(okhttpRequest).execute()) {
ResponseBody responseBody = response.body();
String responseBodyString = responseBody != null ? responseBody.string() : "{}";
@@ -1154,6 +1318,8 @@ public BaseSchematicHttpResponse getEnvironment(
Object errorBody = ObjectMappers.parseErrorBody(responseBodyString);
throw new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response);
+ } catch (JsonProcessingException e) {
+ throw new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e);
} catch (IOException e) {
throw new BaseSchematicException("Network error executing HTTP request", e);
}
@@ -1204,6 +1370,15 @@ public BaseSchematicHttpResponse updateEnvironment(
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
try (Response response = client.newCall(okhttpRequest).execute()) {
ResponseBody responseBody = response.body();
String responseBodyString = responseBody != null ? responseBody.string() : "{}";
@@ -1236,6 +1411,8 @@ public BaseSchematicHttpResponse updateEnvironment(
Object errorBody = ObjectMappers.parseErrorBody(responseBodyString);
throw new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response);
+ } catch (JsonProcessingException e) {
+ throw new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e);
} catch (IOException e) {
throw new BaseSchematicException("Network error executing HTTP request", e);
}
@@ -1266,6 +1443,15 @@ public BaseSchematicHttpResponse deleteEnvironment(
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
try (Response response = client.newCall(okhttpRequest).execute()) {
ResponseBody responseBody = response.body();
String responseBodyString = responseBody != null ? responseBody.string() : "{}";
@@ -1298,6 +1484,8 @@ public BaseSchematicHttpResponse deleteEnvironment(
Object errorBody = ObjectMappers.parseErrorBody(responseBodyString);
throw new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response);
+ } catch (JsonProcessingException e) {
+ throw new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e);
} catch (IOException e) {
throw new BaseSchematicException("Network error executing HTTP request", e);
}
@@ -1326,6 +1514,15 @@ public BaseSchematicHttpResponse quickstart(RequestOptions r
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
try (Response response = client.newCall(okhttpRequest).execute()) {
ResponseBody responseBody = response.body();
String responseBodyString = responseBody != null ? responseBody.string() : "{}";
@@ -1357,6 +1554,8 @@ public BaseSchematicHttpResponse quickstart(RequestOptions r
Object errorBody = ObjectMappers.parseErrorBody(responseBodyString);
throw new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response);
+ } catch (JsonProcessingException e) {
+ throw new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e);
} catch (IOException e) {
throw new BaseSchematicException("Network error executing HTTP request", e);
}
@@ -1385,6 +1584,15 @@ public BaseSchematicHttpResponse getWhoAmI(RequestOptions req
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
try (Response response = client.newCall(okhttpRequest).execute()) {
ResponseBody responseBody = response.body();
String responseBodyString = responseBody != null ? responseBody.string() : "{}";
@@ -1413,6 +1621,8 @@ public BaseSchematicHttpResponse getWhoAmI(RequestOptions req
Object errorBody = ObjectMappers.parseErrorBody(responseBodyString);
throw new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response);
+ } catch (JsonProcessingException e) {
+ throw new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e);
} catch (IOException e) {
throw new BaseSchematicException("Network error executing HTTP request", e);
}
diff --git a/src/main/java/com/schematic/api/resources/accounts/types/CountAccountMembersResponse.java b/src/main/java/com/schematic/api/resources/accounts/types/CountAccountMembersResponse.java
index 049c8f94..ce7268c2 100644
--- a/src/main/java/com/schematic/api/resources/accounts/types/CountAccountMembersResponse.java
+++ b/src/main/java/com/schematic/api/resources/accounts/types/CountAccountMembersResponse.java
@@ -122,7 +122,6 @@ public ParamsStage data(@NotNull CountResponse data) {
}
/**
- * Input parameters
* Input parameters
* @return Reference to {@code this} so that method calls can be chained together.
*/
diff --git a/src/main/java/com/schematic/api/resources/accounts/types/CountApiKeysResponse.java b/src/main/java/com/schematic/api/resources/accounts/types/CountApiKeysResponse.java
index 8426363d..226716aa 100644
--- a/src/main/java/com/schematic/api/resources/accounts/types/CountApiKeysResponse.java
+++ b/src/main/java/com/schematic/api/resources/accounts/types/CountApiKeysResponse.java
@@ -122,7 +122,6 @@ public ParamsStage data(@NotNull CountResponse data) {
}
/**
- * Input parameters
* Input parameters
* @return Reference to {@code this} so that method calls can be chained together.
*/
diff --git a/src/main/java/com/schematic/api/resources/accounts/types/CountAuditLogsResponse.java b/src/main/java/com/schematic/api/resources/accounts/types/CountAuditLogsResponse.java
index 2e05a86f..bae56b88 100644
--- a/src/main/java/com/schematic/api/resources/accounts/types/CountAuditLogsResponse.java
+++ b/src/main/java/com/schematic/api/resources/accounts/types/CountAuditLogsResponse.java
@@ -122,7 +122,6 @@ public ParamsStage data(@NotNull CountResponse data) {
}
/**
- * Input parameters
* Input parameters
* @return Reference to {@code this} so that method calls can be chained together.
*/
diff --git a/src/main/java/com/schematic/api/resources/accounts/types/ListAccountMembersResponse.java b/src/main/java/com/schematic/api/resources/accounts/types/ListAccountMembersResponse.java
index 7b669eb7..22cb889a 100644
--- a/src/main/java/com/schematic/api/resources/accounts/types/ListAccountMembersResponse.java
+++ b/src/main/java/com/schematic/api/resources/accounts/types/ListAccountMembersResponse.java
@@ -122,7 +122,6 @@ public Builder from(ListAccountMembersResponse other) {
}
/**
- * Input parameters
* Input parameters
* @return Reference to {@code this} so that method calls can be chained together.
*/
diff --git a/src/main/java/com/schematic/api/resources/accounts/types/ListApiKeysResponse.java b/src/main/java/com/schematic/api/resources/accounts/types/ListApiKeysResponse.java
index e4de72a5..2695cfe2 100644
--- a/src/main/java/com/schematic/api/resources/accounts/types/ListApiKeysResponse.java
+++ b/src/main/java/com/schematic/api/resources/accounts/types/ListApiKeysResponse.java
@@ -120,7 +120,6 @@ public Builder from(ListApiKeysResponse other) {
}
/**
- * Input parameters
* Input parameters
* @return Reference to {@code this} so that method calls can be chained together.
*/
diff --git a/src/main/java/com/schematic/api/resources/accounts/types/ListAuditLogsResponse.java b/src/main/java/com/schematic/api/resources/accounts/types/ListAuditLogsResponse.java
index 996fba9c..6cfe13c6 100644
--- a/src/main/java/com/schematic/api/resources/accounts/types/ListAuditLogsResponse.java
+++ b/src/main/java/com/schematic/api/resources/accounts/types/ListAuditLogsResponse.java
@@ -120,7 +120,6 @@ public Builder from(ListAuditLogsResponse other) {
}
/**
- * Input parameters
* Input parameters
* @return Reference to {@code this} so that method calls can be chained together.
*/
diff --git a/src/main/java/com/schematic/api/resources/accounts/types/ListEnvironmentsResponse.java b/src/main/java/com/schematic/api/resources/accounts/types/ListEnvironmentsResponse.java
index c2aeb87d..283378d2 100644
--- a/src/main/java/com/schematic/api/resources/accounts/types/ListEnvironmentsResponse.java
+++ b/src/main/java/com/schematic/api/resources/accounts/types/ListEnvironmentsResponse.java
@@ -122,7 +122,6 @@ public Builder from(ListEnvironmentsResponse other) {
}
/**
- * Input parameters
* Input parameters
* @return Reference to {@code this} so that method calls can be chained together.
*/
diff --git a/src/main/java/com/schematic/api/resources/billing/AsyncRawBillingClient.java b/src/main/java/com/schematic/api/resources/billing/AsyncRawBillingClient.java
index baa96d3d..1fe2b636 100644
--- a/src/main/java/com/schematic/api/resources/billing/AsyncRawBillingClient.java
+++ b/src/main/java/com/schematic/api/resources/billing/AsyncRawBillingClient.java
@@ -12,6 +12,7 @@
import com.schematic.api.core.ObjectMappers;
import com.schematic.api.core.QueryStringMapper;
import com.schematic.api.core.RequestOptions;
+import com.schematic.api.core.RetryInterceptor;
import com.schematic.api.errors.BadRequestError;
import com.schematic.api.errors.ForbiddenError;
import com.schematic.api.errors.InternalServerError;
@@ -128,6 +129,15 @@ public CompletableFuture> listCou
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
CompletableFuture> future = new CompletableFuture<>();
client.newCall(okhttpRequest).enqueue(new Callback() {
@Override
@@ -175,6 +185,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO
future.completeExceptionally(new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response));
return;
+ } catch (JsonProcessingException e) {
+ future.completeExceptionally(
+ new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e));
} catch (IOException e) {
future.completeExceptionally(new BaseSchematicException("Network error executing HTTP request", e));
}
@@ -221,6 +234,15 @@ public CompletableFuture>
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
CompletableFuture> future = new CompletableFuture<>();
client.newCall(okhttpRequest).enqueue(new Callback() {
@Override
@@ -269,6 +291,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO
future.completeExceptionally(new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response));
return;
+ } catch (JsonProcessingException e) {
+ future.completeExceptionally(
+ new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e));
} catch (IOException e) {
future.completeExceptionally(new BaseSchematicException("Network error executing HTTP request", e));
}
@@ -308,6 +333,15 @@ public CompletableFuture>
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
CompletableFuture> future = new CompletableFuture<>();
client.newCall(okhttpRequest).enqueue(new Callback() {
@Override
@@ -356,6 +390,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO
future.completeExceptionally(new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response));
return;
+ } catch (JsonProcessingException e) {
+ future.completeExceptionally(
+ new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e));
} catch (IOException e) {
future.completeExceptionally(new BaseSchematicException("Network error executing HTTP request", e));
}
@@ -395,6 +432,15 @@ public CompletableFuture> future = new CompletableFuture<>();
client.newCall(okhttpRequest).enqueue(new Callback() {
@Override
@@ -443,6 +489,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO
future.completeExceptionally(new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response));
return;
+ } catch (JsonProcessingException e) {
+ future.completeExceptionally(
+ new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e));
} catch (IOException e) {
future.completeExceptionally(new BaseSchematicException("Network error executing HTTP request", e));
}
@@ -489,6 +538,15 @@ public CompletableFuture> future = new CompletableFuture<>();
client.newCall(okhttpRequest).enqueue(new Callback() {
@Override
@@ -537,6 +595,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO
future.completeExceptionally(new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response));
return;
+ } catch (JsonProcessingException e) {
+ future.completeExceptionally(
+ new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e));
} catch (IOException e) {
future.completeExceptionally(new BaseSchematicException("Network error executing HTTP request", e));
}
@@ -611,6 +672,15 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) {
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
CompletableFuture> future =
new CompletableFuture<>();
client.newCall(okhttpRequest).enqueue(new Callback() {
@@ -660,6 +730,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO
future.completeExceptionally(new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response));
return;
+ } catch (JsonProcessingException e) {
+ future.completeExceptionally(
+ new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e));
} catch (IOException e) {
future.completeExceptionally(new BaseSchematicException("Network error executing HTTP request", e));
}
@@ -730,6 +803,15 @@ public CompletableFuture> coun
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
CompletableFuture> future = new CompletableFuture<>();
client.newCall(okhttpRequest).enqueue(new Callback() {
@Override
@@ -777,6 +859,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO
future.completeExceptionally(new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response));
return;
+ } catch (JsonProcessingException e) {
+ future.completeExceptionally(
+ new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e));
} catch (IOException e) {
future.completeExceptionally(new BaseSchematicException("Network error executing HTTP request", e));
}
@@ -830,6 +915,15 @@ public CompletableFuture> listIn
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
CompletableFuture> future = new CompletableFuture<>();
client.newCall(okhttpRequest).enqueue(new Callback() {
@Override
@@ -877,6 +971,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO
future.completeExceptionally(new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response));
return;
+ } catch (JsonProcessingException e) {
+ future.completeExceptionally(
+ new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e));
} catch (IOException e) {
future.completeExceptionally(new BaseSchematicException("Network error executing HTTP request", e));
}
@@ -923,6 +1020,15 @@ public CompletableFuture> upser
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
CompletableFuture> future = new CompletableFuture<>();
client.newCall(okhttpRequest).enqueue(new Callback() {
@Override
@@ -970,6 +1076,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO
future.completeExceptionally(new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response));
return;
+ } catch (JsonProcessingException e) {
+ future.completeExceptionally(
+ new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e));
} catch (IOException e) {
future.completeExceptionally(new BaseSchematicException("Network error executing HTTP request", e));
}
@@ -1009,6 +1118,15 @@ public CompletableFuture
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
CompletableFuture> future = new CompletableFuture<>();
client.newCall(okhttpRequest).enqueue(new Callback() {
@Override
@@ -1057,6 +1175,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO
future.completeExceptionally(new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response));
return;
+ } catch (JsonProcessingException e) {
+ future.completeExceptionally(
+ new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e));
} catch (IOException e) {
future.completeExceptionally(new BaseSchematicException("Network error executing HTTP request", e));
}
@@ -1114,6 +1235,15 @@ public CompletableFuture> listMete
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
CompletableFuture> future = new CompletableFuture<>();
client.newCall(okhttpRequest).enqueue(new Callback() {
@Override
@@ -1161,6 +1291,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO
future.completeExceptionally(new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response));
return;
+ } catch (JsonProcessingException e) {
+ future.completeExceptionally(
+ new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e));
} catch (IOException e) {
future.completeExceptionally(new BaseSchematicException("Network error executing HTTP request", e));
}
@@ -1207,6 +1340,15 @@ public CompletableFuture>
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
CompletableFuture> future = new CompletableFuture<>();
client.newCall(okhttpRequest).enqueue(new Callback() {
@Override
@@ -1255,6 +1397,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO
future.completeExceptionally(new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response));
return;
+ } catch (JsonProcessingException e) {
+ future.completeExceptionally(
+ new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e));
} catch (IOException e) {
future.completeExceptionally(new BaseSchematicException("Network error executing HTTP request", e));
}
@@ -1306,6 +1451,15 @@ public CompletableFuture>
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
CompletableFuture> future = new CompletableFuture<>();
client.newCall(okhttpRequest).enqueue(new Callback() {
@Override
@@ -1354,6 +1508,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO
future.completeExceptionally(new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response));
return;
+ } catch (JsonProcessingException e) {
+ future.completeExceptionally(
+ new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e));
} catch (IOException e) {
future.completeExceptionally(new BaseSchematicException("Network error executing HTTP request", e));
}
@@ -1400,6 +1557,15 @@ public CompletableFuture>
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
CompletableFuture> future = new CompletableFuture<>();
client.newCall(okhttpRequest).enqueue(new Callback() {
@Override
@@ -1448,6 +1614,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO
future.completeExceptionally(new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response));
return;
+ } catch (JsonProcessingException e) {
+ future.completeExceptionally(
+ new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e));
} catch (IOException e) {
future.completeExceptionally(new BaseSchematicException("Network error executing HTTP request", e));
}
@@ -1487,6 +1656,15 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) {
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
CompletableFuture> future =
new CompletableFuture<>();
client.newCall(okhttpRequest).enqueue(new Callback() {
@@ -1536,6 +1714,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO
future.completeExceptionally(new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response));
return;
+ } catch (JsonProcessingException e) {
+ future.completeExceptionally(
+ new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e));
} catch (IOException e) {
future.completeExceptionally(new BaseSchematicException("Network error executing HTTP request", e));
}
@@ -1652,6 +1833,15 @@ public CompletableFuture> l
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
CompletableFuture> future = new CompletableFuture<>();
client.newCall(okhttpRequest).enqueue(new Callback() {
@Override
@@ -1700,6 +1890,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO
future.completeExceptionally(new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response));
return;
+ } catch (JsonProcessingException e) {
+ future.completeExceptionally(
+ new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e));
} catch (IOException e) {
future.completeExceptionally(new BaseSchematicException("Network error executing HTTP request", e));
}
@@ -1746,6 +1939,15 @@ public CompletableFuture>
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
CompletableFuture> future = new CompletableFuture<>();
client.newCall(okhttpRequest).enqueue(new Callback() {
@Override
@@ -1794,6 +1996,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO
future.completeExceptionally(new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response));
return;
+ } catch (JsonProcessingException e) {
+ future.completeExceptionally(
+ new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e));
} catch (IOException e) {
future.completeExceptionally(new BaseSchematicException("Network error executing HTTP request", e));
}
@@ -1833,6 +2038,15 @@ public CompletableFuture
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
CompletableFuture> future = new CompletableFuture<>();
client.newCall(okhttpRequest).enqueue(new Callback() {
@Override
@@ -1881,6 +2095,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO
future.completeExceptionally(new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response));
return;
+ } catch (JsonProcessingException e) {
+ future.completeExceptionally(
+ new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e));
} catch (IOException e) {
future.completeExceptionally(new BaseSchematicException("Network error executing HTTP request", e));
}
@@ -1999,6 +2216,15 @@ public CompletableFuture> future =
new CompletableFuture<>();
client.newCall(okhttpRequest).enqueue(new Callback() {
@@ -2048,6 +2274,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO
future.completeExceptionally(new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response));
return;
+ } catch (JsonProcessingException e) {
+ future.completeExceptionally(
+ new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e));
} catch (IOException e) {
future.completeExceptionally(new BaseSchematicException("Network error executing HTTP request", e));
}
@@ -2087,6 +2316,15 @@ public CompletableFuture>
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
CompletableFuture> future = new CompletableFuture<>();
client.newCall(okhttpRequest).enqueue(new Callback() {
@Override
@@ -2135,6 +2373,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO
future.completeExceptionally(new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response));
return;
+ } catch (JsonProcessingException e) {
+ future.completeExceptionally(
+ new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e));
} catch (IOException e) {
future.completeExceptionally(new BaseSchematicException("Network error executing HTTP request", e));
}
@@ -2181,6 +2422,15 @@ public CompletableFuture
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
CompletableFuture> future = new CompletableFuture<>();
client.newCall(okhttpRequest).enqueue(new Callback() {
@Override
@@ -2229,6 +2479,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO
future.completeExceptionally(new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response));
return;
+ } catch (JsonProcessingException e) {
+ future.completeExceptionally(
+ new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e));
} catch (IOException e) {
future.completeExceptionally(new BaseSchematicException("Network error executing HTTP request", e));
}
@@ -2335,6 +2588,15 @@ public CompletableFuture>
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
CompletableFuture> future = new CompletableFuture<>();
client.newCall(okhttpRequest).enqueue(new Callback() {
@Override
@@ -2383,6 +2645,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO
future.completeExceptionally(new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response));
return;
+ } catch (JsonProcessingException e) {
+ future.completeExceptionally(
+ new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e));
} catch (IOException e) {
future.completeExceptionally(new BaseSchematicException("Network error executing HTTP request", e));
}
@@ -2489,6 +2754,15 @@ public CompletableFuture
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
CompletableFuture> future = new CompletableFuture<>();
client.newCall(okhttpRequest).enqueue(new Callback() {
@Override
@@ -2537,6 +2811,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO
future.completeExceptionally(new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response));
return;
+ } catch (JsonProcessingException e) {
+ future.completeExceptionally(
+ new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e));
} catch (IOException e) {
future.completeExceptionally(new BaseSchematicException("Network error executing HTTP request", e));
}
@@ -2583,6 +2860,15 @@ public CompletableFuture> future =
new CompletableFuture<>();
client.newCall(okhttpRequest).enqueue(new Callback() {
@@ -2632,6 +2918,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO
future.completeExceptionally(new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response));
return;
+ } catch (JsonProcessingException e) {
+ future.completeExceptionally(
+ new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e));
} catch (IOException e) {
future.completeExceptionally(new BaseSchematicException("Network error executing HTTP request", e));
}
diff --git a/src/main/java/com/schematic/api/resources/billing/RawBillingClient.java b/src/main/java/com/schematic/api/resources/billing/RawBillingClient.java
index b3482eda..a54ca845 100644
--- a/src/main/java/com/schematic/api/resources/billing/RawBillingClient.java
+++ b/src/main/java/com/schematic/api/resources/billing/RawBillingClient.java
@@ -12,6 +12,7 @@
import com.schematic.api.core.ObjectMappers;
import com.schematic.api.core.QueryStringMapper;
import com.schematic.api.core.RequestOptions;
+import com.schematic.api.core.RetryInterceptor;
import com.schematic.api.errors.BadRequestError;
import com.schematic.api.errors.ForbiddenError;
import com.schematic.api.errors.InternalServerError;
@@ -123,6 +124,15 @@ public BaseSchematicHttpResponse listCoupons(
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
try (Response response = client.newCall(okhttpRequest).execute()) {
ResponseBody responseBody = response.body();
String responseBodyString = responseBody != null ? responseBody.string() : "{}";
@@ -154,6 +164,8 @@ public BaseSchematicHttpResponse listCoupons(
Object errorBody = ObjectMappers.parseErrorBody(responseBodyString);
throw new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response);
+ } catch (JsonProcessingException e) {
+ throw new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e);
} catch (IOException e) {
throw new BaseSchematicException("Network error executing HTTP request", e);
}
@@ -191,6 +203,15 @@ public BaseSchematicHttpResponse upsertBillingCoupo
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
try (Response response = client.newCall(okhttpRequest).execute()) {
ResponseBody responseBody = response.body();
String responseBodyString = responseBody != null ? responseBody.string() : "{}";
@@ -223,6 +244,8 @@ public BaseSchematicHttpResponse upsertBillingCoupo
Object errorBody = ObjectMappers.parseErrorBody(responseBodyString);
throw new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response);
+ } catch (JsonProcessingException e) {
+ throw new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e);
} catch (IOException e) {
throw new BaseSchematicException("Network error executing HTTP request", e);
}
@@ -253,6 +276,15 @@ public BaseSchematicHttpResponse deleteBillingCoupo
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
try (Response response = client.newCall(okhttpRequest).execute()) {
ResponseBody responseBody = response.body();
String responseBodyString = responseBody != null ? responseBody.string() : "{}";
@@ -285,6 +317,8 @@ public BaseSchematicHttpResponse deleteBillingCoupo
Object errorBody = ObjectMappers.parseErrorBody(responseBodyString);
throw new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response);
+ } catch (JsonProcessingException e) {
+ throw new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e);
} catch (IOException e) {
throw new BaseSchematicException("Network error executing HTTP request", e);
}
@@ -315,6 +349,15 @@ public BaseSchematicHttpResponse deleteBillingCus
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
try (Response response = client.newCall(okhttpRequest).execute()) {
ResponseBody responseBody = response.body();
String responseBodyString = responseBody != null ? responseBody.string() : "{}";
@@ -347,6 +390,8 @@ public BaseSchematicHttpResponse deleteBillingCus
Object errorBody = ObjectMappers.parseErrorBody(responseBodyString);
throw new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response);
+ } catch (JsonProcessingException e) {
+ throw new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e);
} catch (IOException e) {
throw new BaseSchematicException("Network error executing HTTP request", e);
}
@@ -385,6 +430,15 @@ public BaseSchematicHttpResponse upsertBillingCus
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
try (Response response = client.newCall(okhttpRequest).execute()) {
ResponseBody responseBody = response.body();
String responseBodyString = responseBody != null ? responseBody.string() : "{}";
@@ -417,6 +471,8 @@ public BaseSchematicHttpResponse upsertBillingCus
Object errorBody = ObjectMappers.parseErrorBody(responseBodyString);
throw new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response);
+ } catch (JsonProcessingException e) {
+ throw new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e);
} catch (IOException e) {
throw new BaseSchematicException("Network error executing HTTP request", e);
}
@@ -481,6 +537,15 @@ public BaseSchematicHttpResponse listCus
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
try (Response response = client.newCall(okhttpRequest).execute()) {
ResponseBody responseBody = response.body();
String responseBodyString = responseBody != null ? responseBody.string() : "{}";
@@ -514,6 +579,8 @@ public BaseSchematicHttpResponse listCus
Object errorBody = ObjectMappers.parseErrorBody(responseBodyString);
throw new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response);
+ } catch (JsonProcessingException e) {
+ throw new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e);
} catch (IOException e) {
throw new BaseSchematicException("Network error executing HTTP request", e);
}
@@ -574,6 +641,15 @@ public BaseSchematicHttpResponse countCustomers(
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
try (Response response = client.newCall(okhttpRequest).execute()) {
ResponseBody responseBody = response.body();
String responseBodyString = responseBody != null ? responseBody.string() : "{}";
@@ -606,6 +682,8 @@ public BaseSchematicHttpResponse countCustomers(
Object errorBody = ObjectMappers.parseErrorBody(responseBodyString);
throw new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response);
+ } catch (JsonProcessingException e) {
+ throw new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e);
} catch (IOException e) {
throw new BaseSchematicException("Network error executing HTTP request", e);
}
@@ -650,6 +728,15 @@ public BaseSchematicHttpResponse listInvoices(
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
try (Response response = client.newCall(okhttpRequest).execute()) {
ResponseBody responseBody = response.body();
String responseBodyString = responseBody != null ? responseBody.string() : "{}";
@@ -681,6 +768,8 @@ public BaseSchematicHttpResponse listInvoices(
Object errorBody = ObjectMappers.parseErrorBody(responseBodyString);
throw new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response);
+ } catch (JsonProcessingException e) {
+ throw new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e);
} catch (IOException e) {
throw new BaseSchematicException("Network error executing HTTP request", e);
}
@@ -718,6 +807,15 @@ public BaseSchematicHttpResponse upsertInvoice(
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
try (Response response = client.newCall(okhttpRequest).execute()) {
ResponseBody responseBody = response.body();
String responseBodyString = responseBody != null ? responseBody.string() : "{}";
@@ -749,6 +847,8 @@ public BaseSchematicHttpResponse upsertInvoice(
Object errorBody = ObjectMappers.parseErrorBody(responseBodyString);
throw new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response);
+ } catch (JsonProcessingException e) {
+ throw new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e);
} catch (IOException e) {
throw new BaseSchematicException("Network error executing HTTP request", e);
}
@@ -779,6 +879,15 @@ public BaseSchematicHttpResponse deleteBillingInvo
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
try (Response response = client.newCall(okhttpRequest).execute()) {
ResponseBody responseBody = response.body();
String responseBodyString = responseBody != null ? responseBody.string() : "{}";
@@ -811,6 +920,8 @@ public BaseSchematicHttpResponse deleteBillingInvo
Object errorBody = ObjectMappers.parseErrorBody(responseBodyString);
throw new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response);
+ } catch (JsonProcessingException e) {
+ throw new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e);
} catch (IOException e) {
throw new BaseSchematicException("Network error executing HTTP request", e);
}
@@ -860,6 +971,15 @@ public BaseSchematicHttpResponse listMeters(
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
try (Response response = client.newCall(okhttpRequest).execute()) {
ResponseBody responseBody = response.body();
String responseBodyString = responseBody != null ? responseBody.string() : "{}";
@@ -891,6 +1011,8 @@ public BaseSchematicHttpResponse listMeters(
Object errorBody = ObjectMappers.parseErrorBody(responseBodyString);
throw new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response);
+ } catch (JsonProcessingException e) {
+ throw new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e);
} catch (IOException e) {
throw new BaseSchematicException("Network error executing HTTP request", e);
}
@@ -928,6 +1050,15 @@ public BaseSchematicHttpResponse upsertBillingMeter(
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
try (Response response = client.newCall(okhttpRequest).execute()) {
ResponseBody responseBody = response.body();
String responseBodyString = responseBody != null ? responseBody.string() : "{}";
@@ -960,6 +1091,8 @@ public BaseSchematicHttpResponse upsertBillingMeter(
Object errorBody = ObjectMappers.parseErrorBody(responseBodyString);
throw new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response);
+ } catch (JsonProcessingException e) {
+ throw new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e);
} catch (IOException e) {
throw new BaseSchematicException("Network error executing HTTP request", e);
}
@@ -1002,6 +1135,15 @@ public BaseSchematicHttpResponse listPaymentMethods(
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
try (Response response = client.newCall(okhttpRequest).execute()) {
ResponseBody responseBody = response.body();
String responseBodyString = responseBody != null ? responseBody.string() : "{}";
@@ -1034,6 +1176,8 @@ public BaseSchematicHttpResponse listPaymentMethods(
Object errorBody = ObjectMappers.parseErrorBody(responseBodyString);
throw new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response);
+ } catch (JsonProcessingException e) {
+ throw new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e);
} catch (IOException e) {
throw new BaseSchematicException("Network error executing HTTP request", e);
}
@@ -1072,6 +1216,15 @@ public BaseSchematicHttpResponse upsertPaymentMetho
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
try (Response response = client.newCall(okhttpRequest).execute()) {
ResponseBody responseBody = response.body();
String responseBodyString = responseBody != null ? responseBody.string() : "{}";
@@ -1104,6 +1257,8 @@ public BaseSchematicHttpResponse upsertPaymentMetho
Object errorBody = ObjectMappers.parseErrorBody(responseBodyString);
throw new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response);
+ } catch (JsonProcessingException e) {
+ throw new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e);
} catch (IOException e) {
throw new BaseSchematicException("Network error executing HTTP request", e);
}
@@ -1135,6 +1290,15 @@ public BaseSchematicHttpResponse delete
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
try (Response response = client.newCall(okhttpRequest).execute()) {
ResponseBody responseBody = response.body();
String responseBodyString = responseBody != null ? responseBody.string() : "{}";
@@ -1168,6 +1332,8 @@ public BaseSchematicHttpResponse delete
Object errorBody = ObjectMappers.parseErrorBody(responseBodyString);
throw new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response);
+ } catch (JsonProcessingException e) {
+ throw new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e);
} catch (IOException e) {
throw new BaseSchematicException("Network error executing HTTP request", e);
}
@@ -1274,6 +1440,15 @@ public BaseSchematicHttpResponse listBillingPrices(
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
try (Response response = client.newCall(okhttpRequest).execute()) {
ResponseBody responseBody = response.body();
String responseBodyString = responseBody != null ? responseBody.string() : "{}";
@@ -1306,6 +1481,8 @@ public BaseSchematicHttpResponse listBillingPrices(
Object errorBody = ObjectMappers.parseErrorBody(responseBodyString);
throw new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response);
+ } catch (JsonProcessingException e) {
+ throw new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e);
} catch (IOException e) {
throw new BaseSchematicException("Network error executing HTTP request", e);
}
@@ -1344,6 +1521,15 @@ public BaseSchematicHttpResponse upsertBillingPrice(
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
try (Response response = client.newCall(okhttpRequest).execute()) {
ResponseBody responseBody = response.body();
String responseBodyString = responseBody != null ? responseBody.string() : "{}";
@@ -1376,6 +1562,8 @@ public BaseSchematicHttpResponse upsertBillingPrice(
Object errorBody = ObjectMappers.parseErrorBody(responseBodyString);
throw new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response);
+ } catch (JsonProcessingException e) {
+ throw new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e);
} catch (IOException e) {
throw new BaseSchematicException("Network error executing HTTP request", e);
}
@@ -1406,6 +1594,15 @@ public BaseSchematicHttpResponse deleteBillingProd
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
try (Response response = client.newCall(okhttpRequest).execute()) {
ResponseBody responseBody = response.body();
String responseBodyString = responseBody != null ? responseBody.string() : "{}";
@@ -1438,6 +1635,8 @@ public BaseSchematicHttpResponse deleteBillingProd
Object errorBody = ObjectMappers.parseErrorBody(responseBodyString);
throw new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response);
+ } catch (JsonProcessingException e) {
+ throw new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e);
} catch (IOException e) {
throw new BaseSchematicException("Network error executing HTTP request", e);
}
@@ -1548,6 +1747,15 @@ public BaseSchematicHttpResponse listBillingPr
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
try (Response response = client.newCall(okhttpRequest).execute()) {
ResponseBody responseBody = response.body();
String responseBodyString = responseBody != null ? responseBody.string() : "{}";
@@ -1580,6 +1788,8 @@ public BaseSchematicHttpResponse listBillingPr
Object errorBody = ObjectMappers.parseErrorBody(responseBodyString);
throw new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response);
+ } catch (JsonProcessingException e) {
+ throw new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e);
} catch (IOException e) {
throw new BaseSchematicException("Network error executing HTTP request", e);
}
@@ -1610,6 +1820,15 @@ public BaseSchematicHttpResponse deleteProductPrice(
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
try (Response response = client.newCall(okhttpRequest).execute()) {
ResponseBody responseBody = response.body();
String responseBodyString = responseBody != null ? responseBody.string() : "{}";
@@ -1642,6 +1861,8 @@ public BaseSchematicHttpResponse deleteProductPrice(
Object errorBody = ObjectMappers.parseErrorBody(responseBodyString);
throw new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response);
+ } catch (JsonProcessingException e) {
+ throw new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e);
} catch (IOException e) {
throw new BaseSchematicException("Network error executing HTTP request", e);
}
@@ -1680,6 +1901,15 @@ public BaseSchematicHttpResponse upsertBillingProd
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
try (Response response = client.newCall(okhttpRequest).execute()) {
ResponseBody responseBody = response.body();
String responseBodyString = responseBody != null ? responseBody.string() : "{}";
@@ -1712,6 +1942,8 @@ public BaseSchematicHttpResponse upsertBillingProd
Object errorBody = ObjectMappers.parseErrorBody(responseBodyString);
throw new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response);
+ } catch (JsonProcessingException e) {
+ throw new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e);
} catch (IOException e) {
throw new BaseSchematicException("Network error executing HTTP request", e);
}
@@ -1809,6 +2041,15 @@ public BaseSchematicHttpResponse listBillingProduct
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
try (Response response = client.newCall(okhttpRequest).execute()) {
ResponseBody responseBody = response.body();
String responseBodyString = responseBody != null ? responseBody.string() : "{}";
@@ -1841,6 +2082,8 @@ public BaseSchematicHttpResponse listBillingProduct
Object errorBody = ObjectMappers.parseErrorBody(responseBodyString);
throw new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response);
+ } catch (JsonProcessingException e) {
+ throw new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e);
} catch (IOException e) {
throw new BaseSchematicException("Network error executing HTTP request", e);
}
@@ -1938,6 +2181,15 @@ public BaseSchematicHttpResponse countBillingProdu
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
try (Response response = client.newCall(okhttpRequest).execute()) {
ResponseBody responseBody = response.body();
String responseBodyString = responseBody != null ? responseBody.string() : "{}";
@@ -1970,6 +2222,8 @@ public BaseSchematicHttpResponse countBillingProdu
Object errorBody = ObjectMappers.parseErrorBody(responseBodyString);
throw new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response);
+ } catch (JsonProcessingException e) {
+ throw new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e);
} catch (IOException e) {
throw new BaseSchematicException("Network error executing HTTP request", e);
}
@@ -2008,6 +2262,15 @@ public BaseSchematicHttpResponse upsertBillin
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
try (Response response = client.newCall(okhttpRequest).execute()) {
ResponseBody responseBody = response.body();
String responseBodyString = responseBody != null ? responseBody.string() : "{}";
@@ -2041,6 +2304,8 @@ public BaseSchematicHttpResponse upsertBillin
Object errorBody = ObjectMappers.parseErrorBody(responseBodyString);
throw new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response);
+ } catch (JsonProcessingException e) {
+ throw new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e);
} catch (IOException e) {
throw new BaseSchematicException("Network error executing HTTP request", e);
}
diff --git a/src/main/java/com/schematic/api/resources/billing/requests/CreateInvoiceRequestBody.java b/src/main/java/com/schematic/api/resources/billing/requests/CreateInvoiceRequestBody.java
index 02d76e55..620be18f 100644
--- a/src/main/java/com/schematic/api/resources/billing/requests/CreateInvoiceRequestBody.java
+++ b/src/main/java/com/schematic/api/resources/billing/requests/CreateInvoiceRequestBody.java
@@ -37,10 +37,14 @@ public final class CreateInvoiceRequestBody {
private final Optional dueDate;
+ private final Optional endingBalance;
+
private final Optional externalId;
private final Optional paymentMethodExternalId;
+ private final Optional startingBalance;
+
private final Optional status;
private final Optional subscriptionExternalId;
@@ -59,8 +63,10 @@ private CreateInvoiceRequestBody(
String currency,
String customerExternalId,
Optional dueDate,
+ Optional endingBalance,
Optional externalId,
Optional paymentMethodExternalId,
+ Optional startingBalance,
Optional status,
Optional subscriptionExternalId,
long subtotal,
@@ -73,8 +79,10 @@ private CreateInvoiceRequestBody(
this.currency = currency;
this.customerExternalId = customerExternalId;
this.dueDate = dueDate;
+ this.endingBalance = endingBalance;
this.externalId = externalId;
this.paymentMethodExternalId = paymentMethodExternalId;
+ this.startingBalance = startingBalance;
this.status = status;
this.subscriptionExternalId = subscriptionExternalId;
this.subtotal = subtotal;
@@ -117,6 +125,11 @@ public Optional getDueDate() {
return dueDate;
}
+ @JsonProperty("ending_balance")
+ public Optional getEndingBalance() {
+ return endingBalance;
+ }
+
@JsonProperty("external_id")
public Optional getExternalId() {
return externalId;
@@ -127,6 +140,11 @@ public Optional getPaymentMethodExternalId() {
return paymentMethodExternalId;
}
+ @JsonProperty("starting_balance")
+ public Optional getStartingBalance() {
+ return startingBalance;
+ }
+
@JsonProperty("status")
public Optional getStatus() {
return status;
@@ -166,8 +184,10 @@ private boolean equalTo(CreateInvoiceRequestBody other) {
&& currency.equals(other.currency)
&& customerExternalId.equals(other.customerExternalId)
&& dueDate.equals(other.dueDate)
+ && endingBalance.equals(other.endingBalance)
&& externalId.equals(other.externalId)
&& paymentMethodExternalId.equals(other.paymentMethodExternalId)
+ && startingBalance.equals(other.startingBalance)
&& status.equals(other.status)
&& subscriptionExternalId.equals(other.subscriptionExternalId)
&& subtotal == other.subtotal
@@ -184,8 +204,10 @@ public int hashCode() {
this.currency,
this.customerExternalId,
this.dueDate,
+ this.endingBalance,
this.externalId,
this.paymentMethodExternalId,
+ this.startingBalance,
this.status,
this.subscriptionExternalId,
this.subtotal,
@@ -242,6 +264,10 @@ public interface _FinalStage {
_FinalStage dueDate(OffsetDateTime dueDate);
+ _FinalStage endingBalance(Optional endingBalance);
+
+ _FinalStage endingBalance(Long endingBalance);
+
_FinalStage externalId(Optional externalId);
_FinalStage externalId(String externalId);
@@ -250,6 +276,10 @@ public interface _FinalStage {
_FinalStage paymentMethodExternalId(String paymentMethodExternalId);
+ _FinalStage startingBalance(Optional startingBalance);
+
+ _FinalStage startingBalance(Long startingBalance);
+
_FinalStage status(Optional status);
_FinalStage status(InvoiceStatus status);
@@ -293,10 +323,14 @@ public static final class Builder
private Optional status = Optional.empty();
+ private Optional startingBalance = Optional.empty();
+
private Optional paymentMethodExternalId = Optional.empty();
private Optional externalId = Optional.empty();
+ private Optional endingBalance = Optional.empty();
+
private Optional dueDate = Optional.empty();
@JsonAnySetter
@@ -313,8 +347,10 @@ public Builder from(CreateInvoiceRequestBody other) {
currency(other.getCurrency());
customerExternalId(other.getCustomerExternalId());
dueDate(other.getDueDate());
+ endingBalance(other.getEndingBalance());
externalId(other.getExternalId());
paymentMethodExternalId(other.getPaymentMethodExternalId());
+ startingBalance(other.getStartingBalance());
status(other.getStatus());
subscriptionExternalId(other.getSubscriptionExternalId());
subtotal(other.getSubtotal());
@@ -410,6 +446,19 @@ public _FinalStage status(Optional status) {
return this;
}
+ @java.lang.Override
+ public _FinalStage startingBalance(Long startingBalance) {
+ this.startingBalance = Optional.ofNullable(startingBalance);
+ return this;
+ }
+
+ @java.lang.Override
+ @JsonSetter(value = "starting_balance", nulls = Nulls.SKIP)
+ public _FinalStage startingBalance(Optional startingBalance) {
+ this.startingBalance = startingBalance;
+ return this;
+ }
+
@java.lang.Override
public _FinalStage paymentMethodExternalId(String paymentMethodExternalId) {
this.paymentMethodExternalId = Optional.ofNullable(paymentMethodExternalId);
@@ -436,6 +485,19 @@ public _FinalStage externalId(Optional externalId) {
return this;
}
+ @java.lang.Override
+ public _FinalStage endingBalance(Long endingBalance) {
+ this.endingBalance = Optional.ofNullable(endingBalance);
+ return this;
+ }
+
+ @java.lang.Override
+ @JsonSetter(value = "ending_balance", nulls = Nulls.SKIP)
+ public _FinalStage endingBalance(Optional endingBalance) {
+ this.endingBalance = endingBalance;
+ return this;
+ }
+
@java.lang.Override
public _FinalStage dueDate(OffsetDateTime dueDate) {
this.dueDate = Optional.ofNullable(dueDate);
@@ -459,8 +521,10 @@ public CreateInvoiceRequestBody build() {
currency,
customerExternalId,
dueDate,
+ endingBalance,
externalId,
paymentMethodExternalId,
+ startingBalance,
status,
subscriptionExternalId,
subtotal,
diff --git a/src/main/java/com/schematic/api/resources/billing/types/CountBillingProductsResponse.java b/src/main/java/com/schematic/api/resources/billing/types/CountBillingProductsResponse.java
index 2828798b..cf40b811 100644
--- a/src/main/java/com/schematic/api/resources/billing/types/CountBillingProductsResponse.java
+++ b/src/main/java/com/schematic/api/resources/billing/types/CountBillingProductsResponse.java
@@ -122,7 +122,6 @@ public ParamsStage data(@NotNull CountResponse data) {
}
/**
- * Input parameters
* Input parameters
* @return Reference to {@code this} so that method calls can be chained together.
*/
diff --git a/src/main/java/com/schematic/api/resources/billing/types/CountCustomersResponse.java b/src/main/java/com/schematic/api/resources/billing/types/CountCustomersResponse.java
index d0f55b80..13b3f7ea 100644
--- a/src/main/java/com/schematic/api/resources/billing/types/CountCustomersResponse.java
+++ b/src/main/java/com/schematic/api/resources/billing/types/CountCustomersResponse.java
@@ -122,7 +122,6 @@ public ParamsStage data(@NotNull CountResponse data) {
}
/**
- * Input parameters
* Input parameters
* @return Reference to {@code this} so that method calls can be chained together.
*/
diff --git a/src/main/java/com/schematic/api/resources/billing/types/ListBillingPricesResponse.java b/src/main/java/com/schematic/api/resources/billing/types/ListBillingPricesResponse.java
index 493f337c..5a59a51c 100644
--- a/src/main/java/com/schematic/api/resources/billing/types/ListBillingPricesResponse.java
+++ b/src/main/java/com/schematic/api/resources/billing/types/ListBillingPricesResponse.java
@@ -120,7 +120,6 @@ public Builder from(ListBillingPricesResponse other) {
}
/**
- * Input parameters
* Input parameters
* @return Reference to {@code this} so that method calls can be chained together.
*/
diff --git a/src/main/java/com/schematic/api/resources/billing/types/ListBillingProductPricesResponse.java b/src/main/java/com/schematic/api/resources/billing/types/ListBillingProductPricesResponse.java
index 893c33b3..fcc79d21 100644
--- a/src/main/java/com/schematic/api/resources/billing/types/ListBillingProductPricesResponse.java
+++ b/src/main/java/com/schematic/api/resources/billing/types/ListBillingProductPricesResponse.java
@@ -122,7 +122,6 @@ public Builder from(ListBillingProductPricesResponse other) {
}
/**
- * Input parameters
* Input parameters
* @return Reference to {@code this} so that method calls can be chained together.
*/
diff --git a/src/main/java/com/schematic/api/resources/billing/types/ListBillingProductsResponse.java b/src/main/java/com/schematic/api/resources/billing/types/ListBillingProductsResponse.java
index 7f5311eb..04f91e65 100644
--- a/src/main/java/com/schematic/api/resources/billing/types/ListBillingProductsResponse.java
+++ b/src/main/java/com/schematic/api/resources/billing/types/ListBillingProductsResponse.java
@@ -122,7 +122,6 @@ public Builder from(ListBillingProductsResponse other) {
}
/**
- * Input parameters
* Input parameters
* @return Reference to {@code this} so that method calls can be chained together.
*/
diff --git a/src/main/java/com/schematic/api/resources/billing/types/ListCouponsResponse.java b/src/main/java/com/schematic/api/resources/billing/types/ListCouponsResponse.java
index 7307a796..a653debc 100644
--- a/src/main/java/com/schematic/api/resources/billing/types/ListCouponsResponse.java
+++ b/src/main/java/com/schematic/api/resources/billing/types/ListCouponsResponse.java
@@ -120,7 +120,6 @@ public Builder from(ListCouponsResponse other) {
}
/**
- * Input parameters
* Input parameters
* @return Reference to {@code this} so that method calls can be chained together.
*/
diff --git a/src/main/java/com/schematic/api/resources/billing/types/ListCustomersWithSubscriptionsResponse.java b/src/main/java/com/schematic/api/resources/billing/types/ListCustomersWithSubscriptionsResponse.java
index 0a2e945a..55862a00 100644
--- a/src/main/java/com/schematic/api/resources/billing/types/ListCustomersWithSubscriptionsResponse.java
+++ b/src/main/java/com/schematic/api/resources/billing/types/ListCustomersWithSubscriptionsResponse.java
@@ -123,7 +123,6 @@ public Builder from(ListCustomersWithSubscriptionsResponse other) {
}
/**
- * Input parameters
* Input parameters
* @return Reference to {@code this} so that method calls can be chained together.
*/
diff --git a/src/main/java/com/schematic/api/resources/billing/types/ListInvoicesResponse.java b/src/main/java/com/schematic/api/resources/billing/types/ListInvoicesResponse.java
index 4183ddea..c61d48d3 100644
--- a/src/main/java/com/schematic/api/resources/billing/types/ListInvoicesResponse.java
+++ b/src/main/java/com/schematic/api/resources/billing/types/ListInvoicesResponse.java
@@ -120,7 +120,6 @@ public Builder from(ListInvoicesResponse other) {
}
/**
- * Input parameters
* Input parameters
* @return Reference to {@code this} so that method calls can be chained together.
*/
diff --git a/src/main/java/com/schematic/api/resources/billing/types/ListMetersResponse.java b/src/main/java/com/schematic/api/resources/billing/types/ListMetersResponse.java
index 51409fe6..6639fca7 100644
--- a/src/main/java/com/schematic/api/resources/billing/types/ListMetersResponse.java
+++ b/src/main/java/com/schematic/api/resources/billing/types/ListMetersResponse.java
@@ -120,7 +120,6 @@ public Builder from(ListMetersResponse other) {
}
/**
- * Input parameters
* Input parameters
* @return Reference to {@code this} so that method calls can be chained together.
*/
diff --git a/src/main/java/com/schematic/api/resources/billing/types/ListPaymentMethodsResponse.java b/src/main/java/com/schematic/api/resources/billing/types/ListPaymentMethodsResponse.java
index 04c5afb8..9167a05a 100644
--- a/src/main/java/com/schematic/api/resources/billing/types/ListPaymentMethodsResponse.java
+++ b/src/main/java/com/schematic/api/resources/billing/types/ListPaymentMethodsResponse.java
@@ -122,7 +122,6 @@ public Builder from(ListPaymentMethodsResponse other) {
}
/**
- * Input parameters
* Input parameters
* @return Reference to {@code this} so that method calls can be chained together.
*/
diff --git a/src/main/java/com/schematic/api/resources/checkout/AsyncRawCheckoutClient.java b/src/main/java/com/schematic/api/resources/checkout/AsyncRawCheckoutClient.java
index d2978c6f..32d9ba20 100644
--- a/src/main/java/com/schematic/api/resources/checkout/AsyncRawCheckoutClient.java
+++ b/src/main/java/com/schematic/api/resources/checkout/AsyncRawCheckoutClient.java
@@ -11,6 +11,7 @@
import com.schematic.api.core.MediaTypes;
import com.schematic.api.core.ObjectMappers;
import com.schematic.api.core.RequestOptions;
+import com.schematic.api.core.RetryInterceptor;
import com.schematic.api.errors.BadRequestError;
import com.schematic.api.errors.ForbiddenError;
import com.schematic.api.errors.InternalServerError;
@@ -82,6 +83,15 @@ public CompletableFuture> in
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
CompletableFuture> future = new CompletableFuture<>();
client.newCall(okhttpRequest).enqueue(new Callback() {
@Override
@@ -129,6 +139,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO
future.completeExceptionally(new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response));
return;
+ } catch (JsonProcessingException e) {
+ future.completeExceptionally(
+ new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e));
} catch (IOException e) {
future.completeExceptionally(new BaseSchematicException("Network error executing HTTP request", e));
}
@@ -175,6 +188,15 @@ public CompletableFuture> get
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
CompletableFuture> future = new CompletableFuture<>();
client.newCall(okhttpRequest).enqueue(new Callback() {
@Override
@@ -222,6 +244,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO
future.completeExceptionally(new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response));
return;
+ } catch (JsonProcessingException e) {
+ future.completeExceptionally(
+ new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e));
} catch (IOException e) {
future.completeExceptionally(new BaseSchematicException("Network error executing HTTP request", e));
}
@@ -268,6 +293,15 @@ public CompletableFuture> future =
new CompletableFuture<>();
client.newCall(okhttpRequest).enqueue(new Callback() {
@@ -317,6 +351,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO
future.completeExceptionally(new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response));
return;
+ } catch (JsonProcessingException e) {
+ future.completeExceptionally(
+ new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e));
} catch (IOException e) {
future.completeExceptionally(new BaseSchematicException("Network error executing HTTP request", e));
}
@@ -362,6 +399,15 @@ public CompletableFuture> managePl
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
CompletableFuture> future = new CompletableFuture<>();
client.newCall(okhttpRequest).enqueue(new Callback() {
@Override
@@ -409,6 +455,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO
future.completeExceptionally(new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response));
return;
+ } catch (JsonProcessingException e) {
+ future.completeExceptionally(
+ new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e));
} catch (IOException e) {
future.completeExceptionally(new BaseSchematicException("Network error executing HTTP request", e));
}
@@ -455,6 +504,15 @@ public CompletableFuture> p
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
CompletableFuture> future = new CompletableFuture<>();
client.newCall(okhttpRequest).enqueue(new Callback() {
@Override
@@ -503,6 +561,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO
future.completeExceptionally(new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response));
return;
+ } catch (JsonProcessingException e) {
+ future.completeExceptionally(
+ new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e));
} catch (IOException e) {
future.completeExceptionally(new BaseSchematicException("Network error executing HTTP request", e));
}
@@ -549,6 +610,15 @@ public CompletableFuture>
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
CompletableFuture> future = new CompletableFuture<>();
client.newCall(okhttpRequest).enqueue(new Callback() {
@Override
@@ -597,6 +667,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO
future.completeExceptionally(new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response));
return;
+ } catch (JsonProcessingException e) {
+ future.completeExceptionally(
+ new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e));
} catch (IOException e) {
future.completeExceptionally(new BaseSchematicException("Network error executing HTTP request", e));
}
@@ -658,6 +731,15 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) {
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
CompletableFuture> future =
new CompletableFuture<>();
client.newCall(okhttpRequest).enqueue(new Callback() {
@@ -707,6 +789,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO
future.completeExceptionally(new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response));
return;
+ } catch (JsonProcessingException e) {
+ future.completeExceptionally(
+ new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e));
} catch (IOException e) {
future.completeExceptionally(new BaseSchematicException("Network error executing HTTP request", e));
}
diff --git a/src/main/java/com/schematic/api/resources/checkout/RawCheckoutClient.java b/src/main/java/com/schematic/api/resources/checkout/RawCheckoutClient.java
index a1505b0f..2ff09bf5 100644
--- a/src/main/java/com/schematic/api/resources/checkout/RawCheckoutClient.java
+++ b/src/main/java/com/schematic/api/resources/checkout/RawCheckoutClient.java
@@ -11,6 +11,7 @@
import com.schematic.api.core.MediaTypes;
import com.schematic.api.core.ObjectMappers;
import com.schematic.api.core.RequestOptions;
+import com.schematic.api.core.RetryInterceptor;
import com.schematic.api.errors.BadRequestError;
import com.schematic.api.errors.ForbiddenError;
import com.schematic.api.errors.InternalServerError;
@@ -77,6 +78,15 @@ public BaseSchematicHttpResponse internal(
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
try (Response response = client.newCall(okhttpRequest).execute()) {
ResponseBody responseBody = response.body();
String responseBodyString = responseBody != null ? responseBody.string() : "{}";
@@ -109,6 +119,8 @@ public BaseSchematicHttpResponse internal(
Object errorBody = ObjectMappers.parseErrorBody(responseBodyString);
throw new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response);
+ } catch (JsonProcessingException e) {
+ throw new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e);
} catch (IOException e) {
throw new BaseSchematicException("Network error executing HTTP request", e);
}
@@ -146,6 +158,15 @@ public BaseSchematicHttpResponse getCheckoutData(
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
try (Response response = client.newCall(okhttpRequest).execute()) {
ResponseBody responseBody = response.body();
String responseBodyString = responseBody != null ? responseBody.string() : "{}";
@@ -178,6 +199,8 @@ public BaseSchematicHttpResponse getCheckoutData(
Object errorBody = ObjectMappers.parseErrorBody(responseBodyString);
throw new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response);
+ } catch (JsonProcessingException e) {
+ throw new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e);
} catch (IOException e) {
throw new BaseSchematicException("Network error executing HTTP request", e);
}
@@ -216,6 +239,15 @@ public BaseSchematicHttpResponse previewCheckou
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
try (Response response = client.newCall(okhttpRequest).execute()) {
ResponseBody responseBody = response.body();
String responseBodyString = responseBody != null ? responseBody.string() : "{}";
@@ -248,6 +280,8 @@ public BaseSchematicHttpResponse previewCheckou
Object errorBody = ObjectMappers.parseErrorBody(responseBodyString);
throw new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response);
+ } catch (JsonProcessingException e) {
+ throw new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e);
} catch (IOException e) {
throw new BaseSchematicException("Network error executing HTTP request", e);
}
@@ -285,6 +319,15 @@ public BaseSchematicHttpResponse managePlan(
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
try (Response response = client.newCall(okhttpRequest).execute()) {
ResponseBody responseBody = response.body();
String responseBodyString = responseBody != null ? responseBody.string() : "{}";
@@ -316,6 +359,8 @@ public BaseSchematicHttpResponse managePlan(
Object errorBody = ObjectMappers.parseErrorBody(responseBodyString);
throw new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response);
+ } catch (JsonProcessingException e) {
+ throw new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e);
} catch (IOException e) {
throw new BaseSchematicException("Network error executing HTTP request", e);
}
@@ -353,6 +398,15 @@ public BaseSchematicHttpResponse previewManagePlan(
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
try (Response response = client.newCall(okhttpRequest).execute()) {
ResponseBody responseBody = response.body();
String responseBodyString = responseBody != null ? responseBody.string() : "{}";
@@ -385,6 +439,8 @@ public BaseSchematicHttpResponse previewManagePlan(
Object errorBody = ObjectMappers.parseErrorBody(responseBodyString);
throw new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response);
+ } catch (JsonProcessingException e) {
+ throw new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e);
} catch (IOException e) {
throw new BaseSchematicException("Network error executing HTTP request", e);
}
@@ -422,6 +478,15 @@ public BaseSchematicHttpResponse cancelSubscription(
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
try (Response response = client.newCall(okhttpRequest).execute()) {
ResponseBody responseBody = response.body();
String responseBodyString = responseBody != null ? responseBody.string() : "{}";
@@ -454,6 +519,8 @@ public BaseSchematicHttpResponse cancelSubscription(
Object errorBody = ObjectMappers.parseErrorBody(responseBodyString);
throw new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response);
+ } catch (JsonProcessingException e) {
+ throw new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e);
} catch (IOException e) {
throw new BaseSchematicException("Network error executing HTTP request", e);
}
@@ -506,6 +573,15 @@ public BaseSchematicHttpResponse upd
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
try (Response response = client.newCall(okhttpRequest).execute()) {
ResponseBody responseBody = response.body();
String responseBodyString = responseBody != null ? responseBody.string() : "{}";
@@ -539,6 +615,8 @@ public BaseSchematicHttpResponse upd
Object errorBody = ObjectMappers.parseErrorBody(responseBodyString);
throw new BaseSchematicApiException(
"Error with status code " + response.code(), response.code(), errorBody, response);
+ } catch (JsonProcessingException e) {
+ throw new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e);
} catch (IOException e) {
throw new BaseSchematicException("Network error executing HTTP request", e);
}
diff --git a/src/main/java/com/schematic/api/resources/companies/AsyncRawCompaniesClient.java b/src/main/java/com/schematic/api/resources/companies/AsyncRawCompaniesClient.java
index 72443aa7..1190e7ef 100644
--- a/src/main/java/com/schematic/api/resources/companies/AsyncRawCompaniesClient.java
+++ b/src/main/java/com/schematic/api/resources/companies/AsyncRawCompaniesClient.java
@@ -12,6 +12,7 @@
import com.schematic.api.core.ObjectMappers;
import com.schematic.api.core.QueryStringMapper;
import com.schematic.api.core.RequestOptions;
+import com.schematic.api.core.RetryInterceptor;
import com.schematic.api.errors.BadRequestError;
import com.schematic.api.errors.ForbiddenError;
import com.schematic.api.errors.InternalServerError;
@@ -239,6 +240,15 @@ public CompletableFuture