Skip to content

Commit

Permalink
🌿 Fern Regeneration -- February 3, 2025 (#15)
Browse files Browse the repository at this point in the history
* SDK regeneration

* fixes

---------

Co-authored-by: fern-api <115122769+fern-api[bot]@users.noreply.github.com>
Co-authored-by: Ben Papillon <[email protected]>
  • Loading branch information
fern-api[bot] and bpapillon authored Feb 5, 2025
1 parent 68c64f1 commit 6bcd3ff
Show file tree
Hide file tree
Showing 42 changed files with 1,900 additions and 370 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ java {

group = 'com.schematichq'

version = '1.1.0'
version = '1.1.1'

jar {
dependsOn(":generatePomFileForMavenPublication")
Expand Down Expand Up @@ -79,7 +79,7 @@ publishing {
maven(MavenPublication) {
groupId = 'com.schematichq'
artifactId = 'schematic-java'
version = '1.1.0'
version = '1.1.1'
from components.java
pom {
name = 'schematic'
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/schematic/api/Schematic.java
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ private static ClientOptions buildClientOptions(String apiKey, Builder builder)
String basePath = builder.basePath != null ? builder.basePath : "https://api.schematichq.com";
return ClientOptions.builder()
.environment(Environment.custom(basePath))
.addHeader("Authorization", "Bearer " + apiKey)
.addHeader("X-Schematic-Api-Key", apiKey)
.addHeader("Content-Type", "application/json")
.build();
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/schematic/api/core/ClientOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ private ClientOptions(
{
put("X-Fern-Language", "JAVA");
put("X-Fern-SDK-Name", "com.schematic.fern:api-sdk");
put("X-Fern-SDK-Version", "1.1.0");
put("X-Fern-SDK-Version", "1.1.1");
}
});
this.headerSuppliers = headerSuppliers;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/schematic/api/core/Stream.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import java.util.Scanner;

/**
* The {@code Stream} class implmenets {@link Iterable} to provide a simple mechanism for reading and parsing
* The {@code Stream} class implements {@link Iterable} to provide a simple mechanism for reading and parsing
* objects of a given type from data streamed via a {@link Reader} using a specified delimiter.
* <p>
* {@code Stream} assumes that data is being pushed to the provided {@link Reader} asynchronously and utilizes a
Expand All @@ -23,7 +23,7 @@ public final class Stream<T> implements Iterable<T> {
*/
private final Class<T> valueType;
/**
* The {@link Scanner} used for reading from the input stream and blocking when neede during iteration.
* The {@link Scanner} used for reading from the input stream and blocking when needed during iteration.
*/
private final Scanner scanner;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public IssueTemporaryAccessTokenResponse issueTemporaryAccessToken(
.method("POST", body)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Content-Type", "application/json")
.addHeader("Accept", "application/json")
.build();
OkHttpClient client = clientOptions.httpClient();
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ public UpsertBillingCouponResponse upsertBillingCoupon(
.method("POST", body)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Content-Type", "application/json")
.addHeader("Accept", "application/json")
.build();
OkHttpClient client = clientOptions.httpClient();
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
Expand Down Expand Up @@ -148,6 +149,7 @@ public UpsertBillingCustomerResponse upsertBillingCustomer(
.method("POST", body)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Content-Type", "application/json")
.addHeader("Accept", "application/json")
.build();
OkHttpClient client = clientOptions.httpClient();
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
Expand Down Expand Up @@ -218,7 +220,8 @@ public ListCustomersResponse listCustomers(ListCustomersRequest request, Request
.url(httpUrl.build())
.method("GET", null)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Content-Type", "application/json");
.addHeader("Content-Type", "application/json")
.addHeader("Accept", "application/json");
Request okhttpRequest = _requestBuilder.build();
OkHttpClient client = clientOptions.httpClient();
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
Expand Down Expand Up @@ -289,7 +292,8 @@ public CountCustomersResponse countCustomers(CountCustomersRequest request, Requ
.url(httpUrl.build())
.method("GET", null)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Content-Type", "application/json");
.addHeader("Content-Type", "application/json")
.addHeader("Accept", "application/json");
Request okhttpRequest = _requestBuilder.build();
OkHttpClient client = clientOptions.httpClient();
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
Expand Down Expand Up @@ -355,7 +359,8 @@ public ListInvoicesResponse listInvoices(ListInvoicesRequest request, RequestOpt
.url(httpUrl.build())
.method("GET", null)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Content-Type", "application/json");
.addHeader("Content-Type", "application/json")
.addHeader("Accept", "application/json");
Request okhttpRequest = _requestBuilder.build();
OkHttpClient client = clientOptions.httpClient();
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
Expand Down Expand Up @@ -415,6 +420,7 @@ public UpsertInvoiceResponse upsertInvoice(CreateInvoiceRequestBody request, Req
.method("POST", body)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Content-Type", "application/json")
.addHeader("Accept", "application/json")
.build();
OkHttpClient client = clientOptions.httpClient();
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
Expand Down Expand Up @@ -478,7 +484,8 @@ public ListMetersResponse listMeters(ListMetersRequest request, RequestOptions r
.url(httpUrl.build())
.method("GET", null)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Content-Type", "application/json");
.addHeader("Content-Type", "application/json")
.addHeader("Accept", "application/json");
Request okhttpRequest = _requestBuilder.build();
OkHttpClient client = clientOptions.httpClient();
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
Expand Down Expand Up @@ -539,6 +546,7 @@ public UpsertBillingMeterResponse upsertBillingMeter(
.method("POST", body)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Content-Type", "application/json")
.addHeader("Accept", "application/json")
.build();
OkHttpClient client = clientOptions.httpClient();
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
Expand Down Expand Up @@ -605,7 +613,8 @@ public ListPaymentMethodsResponse listPaymentMethods(
.url(httpUrl.build())
.method("GET", null)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Content-Type", "application/json");
.addHeader("Content-Type", "application/json")
.addHeader("Accept", "application/json");
Request okhttpRequest = _requestBuilder.build();
OkHttpClient client = clientOptions.httpClient();
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
Expand Down Expand Up @@ -666,6 +675,7 @@ public UpsertPaymentMethodResponse upsertPaymentMethod(
.method("POST", body)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Content-Type", "application/json")
.addHeader("Accept", "application/json")
.build();
OkHttpClient client = clientOptions.httpClient();
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
Expand Down Expand Up @@ -739,7 +749,8 @@ public SearchBillingPricesResponse searchBillingPrices(
.url(httpUrl.build())
.method("GET", null)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Content-Type", "application/json");
.addHeader("Content-Type", "application/json")
.addHeader("Accept", "application/json");
Request okhttpRequest = _requestBuilder.build();
OkHttpClient client = clientOptions.httpClient();
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
Expand Down Expand Up @@ -800,6 +811,7 @@ public UpsertBillingPriceResponse upsertBillingPrice(
.method("POST", body)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Content-Type", "application/json")
.addHeader("Accept", "application/json")
.build();
OkHttpClient client = clientOptions.httpClient();
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
Expand Down Expand Up @@ -887,7 +899,8 @@ public ListProductPricesResponse listProductPrices(
.url(httpUrl.build())
.method("GET", null)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Content-Type", "application/json");
.addHeader("Content-Type", "application/json")
.addHeader("Accept", "application/json");
Request okhttpRequest = _requestBuilder.build();
OkHttpClient client = clientOptions.httpClient();
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
Expand Down Expand Up @@ -941,6 +954,7 @@ public DeleteProductPriceResponse deleteProductPrice(String billingId, RequestOp
.method("DELETE", null)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Content-Type", "application/json")
.addHeader("Accept", "application/json")
.build();
OkHttpClient client = clientOptions.httpClient();
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
Expand Down Expand Up @@ -1001,6 +1015,7 @@ public UpsertBillingProductResponse upsertBillingProduct(
.method("POST", body)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Content-Type", "application/json")
.addHeader("Accept", "application/json")
.build();
OkHttpClient client = clientOptions.httpClient();
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
Expand Down Expand Up @@ -1088,7 +1103,8 @@ public ListBillingProductsResponse listBillingProducts(
.url(httpUrl.build())
.method("GET", null)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Content-Type", "application/json");
.addHeader("Content-Type", "application/json")
.addHeader("Accept", "application/json");
Request okhttpRequest = _requestBuilder.build();
OkHttpClient client = clientOptions.httpClient();
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
Expand Down Expand Up @@ -1176,7 +1192,8 @@ public CountBillingProductsResponse countBillingProducts(
.url(httpUrl.build())
.method("GET", null)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Content-Type", "application/json");
.addHeader("Content-Type", "application/json")
.addHeader("Accept", "application/json");
Request okhttpRequest = _requestBuilder.build();
OkHttpClient client = clientOptions.httpClient();
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
Expand Down Expand Up @@ -1237,6 +1254,7 @@ public UpsertBillingSubscriptionResponse upsertBillingSubscription(
.method("POST", body)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Content-Type", "application/json")
.addHeader("Accept", "application/json")
.build();
OkHttpClient client = clientOptions.httpClient();
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ public final class CreateBillingPriceRequestBody {

private final String interval;

private final boolean isActive;

private final Optional<String> meterId;

private final int price;
Expand All @@ -40,6 +42,7 @@ public final class CreateBillingPriceRequestBody {
private CreateBillingPriceRequestBody(
String currency,
String interval,
boolean isActive,
Optional<String> meterId,
int price,
String priceExternalId,
Expand All @@ -48,6 +51,7 @@ private CreateBillingPriceRequestBody(
Map<String, Object> additionalProperties) {
this.currency = currency;
this.interval = interval;
this.isActive = isActive;
this.meterId = meterId;
this.price = price;
this.priceExternalId = priceExternalId;
Expand All @@ -66,6 +70,11 @@ public String getInterval() {
return interval;
}

@JsonProperty("is_active")
public boolean getIsActive() {
return isActive;
}

@JsonProperty("meter_id")
public Optional<String> getMeterId() {
return meterId;
Expand Down Expand Up @@ -105,6 +114,7 @@ public Map<String, Object> getAdditionalProperties() {
private boolean equalTo(CreateBillingPriceRequestBody other) {
return currency.equals(other.currency)
&& interval.equals(other.interval)
&& isActive == other.isActive
&& meterId.equals(other.meterId)
&& price == other.price
&& priceExternalId.equals(other.priceExternalId)
Expand All @@ -117,6 +127,7 @@ public int hashCode() {
return Objects.hash(
this.currency,
this.interval,
this.isActive,
this.meterId,
this.price,
this.priceExternalId,
Expand All @@ -140,7 +151,11 @@ public interface CurrencyStage {
}

public interface IntervalStage {
PriceStage interval(@NotNull String interval);
IsActiveStage interval(@NotNull String interval);
}

public interface IsActiveStage {
PriceStage isActive(boolean isActive);
}

public interface PriceStage {
Expand Down Expand Up @@ -171,6 +186,7 @@ public interface _FinalStage {
public static final class Builder
implements CurrencyStage,
IntervalStage,
IsActiveStage,
PriceStage,
PriceExternalIdStage,
ProductExternalIdStage,
Expand All @@ -180,6 +196,8 @@ public static final class Builder

private String interval;

private boolean isActive;

private int price;

private String priceExternalId;
Expand All @@ -199,6 +217,7 @@ private Builder() {}
public Builder from(CreateBillingPriceRequestBody other) {
currency(other.getCurrency());
interval(other.getInterval());
isActive(other.getIsActive());
meterId(other.getMeterId());
price(other.getPrice());
priceExternalId(other.getPriceExternalId());
Expand All @@ -216,11 +235,18 @@ public IntervalStage currency(@NotNull String currency) {

@java.lang.Override
@JsonSetter("interval")
public PriceStage interval(@NotNull String interval) {
public IsActiveStage interval(@NotNull String interval) {
this.interval = Objects.requireNonNull(interval, "interval must not be null");
return this;
}

@java.lang.Override
@JsonSetter("is_active")
public PriceStage isActive(boolean isActive) {
this.isActive = isActive;
return this;
}

@java.lang.Override
@JsonSetter("price")
public PriceExternalIdStage price(int price) {
Expand Down Expand Up @@ -267,6 +293,7 @@ public CreateBillingPriceRequestBody build() {
return new CreateBillingPriceRequestBody(
currency,
interval,
isActive,
meterId,
price,
priceExternalId,
Expand Down
Loading

0 comments on commit 6bcd3ff

Please sign in to comment.