Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .fern/metadata.json
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -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"
}
8 changes: 7 additions & 1 deletion .fern/replay.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

46 changes: 30 additions & 16 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down Expand Up @@ -52,7 +62,7 @@ java {

group = 'com.schematichq'

version = '1.5.0'
version = '1.5.1'

jar {
dependsOn(":generatePomFileForMavenPublication")
Expand Down Expand Up @@ -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'
Expand All @@ -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 {
Expand All @@ -132,5 +148,3 @@ signing {
useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword)
sign publishing.publications.maven
}

sonatypeCentralUpload.dependsOn build
56 changes: 40 additions & 16 deletions reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -1844,6 +1844,14 @@ client.billing().upsertInvoice(
<dl>
<dd>

**endingBalance:** `Optional<Long>`

</dd>
</dl>

<dl>
<dd>

**externalId:** `Optional<String>`

</dd>
Expand All @@ -1860,6 +1868,14 @@ client.billing().upsertInvoice(
<dl>
<dd>

**startingBalance:** `Optional<Long>`

</dd>
</dl>

<dl>
<dd>

**status:** `Optional<InvoiceStatus>`

</dd>
Expand Down Expand Up @@ -10858,6 +10874,14 @@ client.entitlements().createPlanEntitlement(
<dl>
<dd>

**warningTiers:** `Optional<List<WarningTierRequestBody>>`

</dd>
</dl>

<dl>
<dd>

**yearlyMeteredPriceId:** `Optional<String>`

</dd>
Expand Down Expand Up @@ -11184,6 +11208,14 @@ client.entitlements().updatePlanEntitlement(
<dl>
<dd>

**warningTiers:** `Optional<List<WarningTierRequestBody>>`

</dd>
</dl>

<dl>
<dd>

**yearlyMeteredPriceId:** `Optional<String>`

</dd>
Expand Down Expand Up @@ -11545,6 +11577,14 @@ client.entitlements().upsertPlanEntitlementForBillingProduct(
<dl>
<dd>

**warningTiers:** `Optional<List<WarningTierRequestBody>>`

</dd>
</dl>

<dl>
<dd>

**yearlyMeteredPriceId:** `Optional<String>`

</dd>
Expand Down Expand Up @@ -13799,14 +13839,6 @@ client.planbundle().createPlanBundle(

**plan:** `Optional<CreatePlanRequestBody>`

</dd>
</dl>

<dl>
<dd>

**traits:** `Optional<List<UpdatePlanTraitTraitRequestBody>>`

</dd>
</dl>
</dd>
Expand Down Expand Up @@ -13900,14 +13932,6 @@ client.planbundle().updatePlanBundle(

**planVersionId:** `Optional<String>`

</dd>
</dl>

<dl>
<dd>

**traits:** `Optional<List<UpdatePlanTraitTraitRequestBody>>`

</dd>
</dl>
</dd>
Expand Down
14 changes: 14 additions & 0 deletions src/main/java/com/schematic/api/AsyncRawBaseSchematic.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -50,6 +52,15 @@ public CompletableFuture<BaseSchematicHttpResponse<Void>> 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<BaseSchematicHttpResponse<Void>> future = new CompletableFuture<>();
client.newCall(okhttpRequest).enqueue(new Callback() {
@Override
Expand All @@ -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));
}
Expand Down
13 changes: 13 additions & 0 deletions src/main/java/com/schematic/api/RawBaseSchematic.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -46,6 +48,15 @@ public BaseSchematicHttpResponse<Void> 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()) {
Expand All @@ -55,6 +66,8 @@ public BaseSchematicHttpResponse<Void> 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);
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/schematic/api/core/ClientOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ private ClientOptions(
this.headers.putAll(headers);
this.headers.putAll(new HashMap<String, String>() {
{
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;
Expand Down
15 changes: 11 additions & 4 deletions src/main/java/com/schematic/api/core/DateTimeDeserializer.java
Original file line number Diff line number Diff line change
Expand Up @@ -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<OffsetDateTime> {
private static final SimpleModule MODULE;
Expand Down Expand Up @@ -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) {
Expand Down
Loading
Loading