diff --git a/build.gradle b/build.gradle
index 46a07fb..6896826 100644
--- a/build.gradle
+++ b/build.gradle
@@ -48,7 +48,7 @@ java {
group = 'com.schematichq'
-version = '1.1.0'
+version = '1.1.1'
jar {
dependsOn(":generatePomFileForMavenPublication")
@@ -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'
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index cea7a79..e18bc25 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -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
diff --git a/src/main/java/com/schematic/api/Schematic.java b/src/main/java/com/schematic/api/Schematic.java
index 283ae44..eac478f 100644
--- a/src/main/java/com/schematic/api/Schematic.java
+++ b/src/main/java/com/schematic/api/Schematic.java
@@ -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();
}
diff --git a/src/main/java/com/schematic/api/core/ClientOptions.java b/src/main/java/com/schematic/api/core/ClientOptions.java
index f685454..653a2c9 100644
--- a/src/main/java/com/schematic/api/core/ClientOptions.java
+++ b/src/main/java/com/schematic/api/core/ClientOptions.java
@@ -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;
diff --git a/src/main/java/com/schematic/api/core/Stream.java b/src/main/java/com/schematic/api/core/Stream.java
index 219cda1..89ae9c7 100644
--- a/src/main/java/com/schematic/api/core/Stream.java
+++ b/src/main/java/com/schematic/api/core/Stream.java
@@ -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.
*
* {@code Stream} assumes that data is being pushed to the provided {@link Reader} asynchronously and utilizes a
@@ -23,7 +23,7 @@ public final class Stream implements Iterable {
*/
private final Class 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;
diff --git a/src/main/java/com/schematic/api/resources/accesstokens/AccesstokensClient.java b/src/main/java/com/schematic/api/resources/accesstokens/AccesstokensClient.java
index 05807ab..6f6bd7a 100644
--- a/src/main/java/com/schematic/api/resources/accesstokens/AccesstokensClient.java
+++ b/src/main/java/com/schematic/api/resources/accesstokens/AccesstokensClient.java
@@ -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()) {
diff --git a/src/main/java/com/schematic/api/resources/billing/BillingClient.java b/src/main/java/com/schematic/api/resources/billing/BillingClient.java
index ab399c2..e706a29 100644
--- a/src/main/java/com/schematic/api/resources/billing/BillingClient.java
+++ b/src/main/java/com/schematic/api/resources/billing/BillingClient.java
@@ -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()) {
@@ -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()) {
@@ -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()) {
@@ -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()) {
@@ -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()) {
@@ -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()) {
@@ -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()) {
@@ -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()) {
@@ -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()) {
@@ -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()) {
@@ -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()) {
@@ -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()) {
@@ -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()) {
@@ -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()) {
@@ -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()) {
@@ -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()) {
@@ -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()) {
@@ -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()) {
diff --git a/src/main/java/com/schematic/api/resources/billing/requests/CreateBillingPriceRequestBody.java b/src/main/java/com/schematic/api/resources/billing/requests/CreateBillingPriceRequestBody.java
index 4bdf0c1..c64a0c4 100644
--- a/src/main/java/com/schematic/api/resources/billing/requests/CreateBillingPriceRequestBody.java
+++ b/src/main/java/com/schematic/api/resources/billing/requests/CreateBillingPriceRequestBody.java
@@ -25,6 +25,8 @@ public final class CreateBillingPriceRequestBody {
private final String interval;
+ private final boolean isActive;
+
private final Optional meterId;
private final int price;
@@ -40,6 +42,7 @@ public final class CreateBillingPriceRequestBody {
private CreateBillingPriceRequestBody(
String currency,
String interval,
+ boolean isActive,
Optional meterId,
int price,
String priceExternalId,
@@ -48,6 +51,7 @@ private CreateBillingPriceRequestBody(
Map additionalProperties) {
this.currency = currency;
this.interval = interval;
+ this.isActive = isActive;
this.meterId = meterId;
this.price = price;
this.priceExternalId = priceExternalId;
@@ -66,6 +70,11 @@ public String getInterval() {
return interval;
}
+ @JsonProperty("is_active")
+ public boolean getIsActive() {
+ return isActive;
+ }
+
@JsonProperty("meter_id")
public Optional getMeterId() {
return meterId;
@@ -105,6 +114,7 @@ public Map 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)
@@ -117,6 +127,7 @@ public int hashCode() {
return Objects.hash(
this.currency,
this.interval,
+ this.isActive,
this.meterId,
this.price,
this.priceExternalId,
@@ -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 {
@@ -171,6 +186,7 @@ public interface _FinalStage {
public static final class Builder
implements CurrencyStage,
IntervalStage,
+ IsActiveStage,
PriceStage,
PriceExternalIdStage,
ProductExternalIdStage,
@@ -180,6 +196,8 @@ public static final class Builder
private String interval;
+ private boolean isActive;
+
private int price;
private String priceExternalId;
@@ -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());
@@ -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) {
@@ -267,6 +293,7 @@ public CreateBillingPriceRequestBody build() {
return new CreateBillingPriceRequestBody(
currency,
interval,
+ isActive,
meterId,
price,
priceExternalId,
diff --git a/src/main/java/com/schematic/api/resources/checkout/CheckoutClient.java b/src/main/java/com/schematic/api/resources/checkout/CheckoutClient.java
index da36bfd..aa0c5f6 100644
--- a/src/main/java/com/schematic/api/resources/checkout/CheckoutClient.java
+++ b/src/main/java/com/schematic/api/resources/checkout/CheckoutClient.java
@@ -17,6 +17,7 @@
import com.schematic.api.errors.UnauthorizedError;
import com.schematic.api.resources.checkout.requests.UpdateTrialEndRequestBody;
import com.schematic.api.resources.checkout.types.CheckoutInternalResponse;
+import com.schematic.api.resources.checkout.types.GetCheckoutDataResponse;
import com.schematic.api.resources.checkout.types.PreviewCheckoutInternalResponse;
import com.schematic.api.resources.checkout.types.UpdateCustomerSubscriptionTrialEndResponse;
import com.schematic.api.types.ApiError;
@@ -59,6 +60,7 @@ public CheckoutInternalResponse internal(
.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()) {
@@ -97,6 +99,61 @@ public CheckoutInternalResponse internal(
}
}
+ public GetCheckoutDataResponse getCheckoutData(String checkoutInternalId) {
+ return getCheckoutData(checkoutInternalId, null);
+ }
+
+ public GetCheckoutDataResponse getCheckoutData(String checkoutInternalId, RequestOptions requestOptions) {
+ HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ .newBuilder()
+ .addPathSegments("checkout-internal")
+ .addPathSegment(checkoutInternalId)
+ .addPathSegments("data")
+ .build();
+ Request okhttpRequest = new Request.Builder()
+ .url(httpUrl)
+ .method("GET", 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()) {
+ client = clientOptions.httpClientWithTimeout(requestOptions);
+ }
+ try (Response response = client.newCall(okhttpRequest).execute()) {
+ ResponseBody responseBody = response.body();
+ if (response.isSuccessful()) {
+ return ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), GetCheckoutDataResponse.class);
+ }
+ String responseBodyString = responseBody != null ? responseBody.string() : "{}";
+ try {
+ switch (response.code()) {
+ case 401:
+ throw new UnauthorizedError(
+ ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ApiError.class));
+ case 403:
+ throw new ForbiddenError(
+ ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ApiError.class));
+ case 404:
+ throw new NotFoundError(
+ ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ApiError.class));
+ case 500:
+ throw new InternalServerError(
+ ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ApiError.class));
+ }
+ } catch (JsonProcessingException ignored) {
+ // unable to map error response, throwing generic error
+ }
+ throw new BaseSchematicApiException(
+ "Error with status code " + response.code(),
+ response.code(),
+ ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class));
+ } catch (IOException e) {
+ throw new BaseSchematicException("Network error executing HTTP request", e);
+ }
+ }
+
public PreviewCheckoutInternalResponse previewCheckoutInternal(ChangeSubscriptionInternalRequestBody request) {
return previewCheckoutInternal(request, null);
}
@@ -119,6 +176,7 @@ public PreviewCheckoutInternalResponse previewCheckoutInternal(
.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()) {
@@ -158,6 +216,11 @@ public PreviewCheckoutInternalResponse previewCheckoutInternal(
}
}
+ public UpdateCustomerSubscriptionTrialEndResponse updateCustomerSubscriptionTrialEnd(String subscriptionId) {
+ return updateCustomerSubscriptionTrialEnd(
+ subscriptionId, UpdateTrialEndRequestBody.builder().build());
+ }
+
public UpdateCustomerSubscriptionTrialEndResponse updateCustomerSubscriptionTrialEnd(
String subscriptionId, UpdateTrialEndRequestBody request) {
return updateCustomerSubscriptionTrialEnd(subscriptionId, request, null);
@@ -183,6 +246,7 @@ public UpdateCustomerSubscriptionTrialEndResponse updateCustomerSubscriptionTria
.method("PUT", 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()) {
diff --git a/src/main/java/com/schematic/api/resources/checkout/types/GetCheckoutDataResponse.java b/src/main/java/com/schematic/api/resources/checkout/types/GetCheckoutDataResponse.java
new file mode 100644
index 0000000..bb79648
--- /dev/null
+++ b/src/main/java/com/schematic/api/resources/checkout/types/GetCheckoutDataResponse.java
@@ -0,0 +1,155 @@
+/**
+ * This file was auto-generated by Fern from our API Definition.
+ */
+package com.schematic.api.resources.checkout.types;
+
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonSetter;
+import com.fasterxml.jackson.annotation.Nulls;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import com.schematic.api.core.ObjectMappers;
+import com.schematic.api.types.CheckoutDataResponseData;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.Objects;
+import org.jetbrains.annotations.NotNull;
+
+@JsonInclude(JsonInclude.Include.NON_ABSENT)
+@JsonDeserialize(builder = GetCheckoutDataResponse.Builder.class)
+public final class GetCheckoutDataResponse {
+ private final CheckoutDataResponseData data;
+
+ private final Map params;
+
+ private final Map additionalProperties;
+
+ private GetCheckoutDataResponse(
+ CheckoutDataResponseData data, Map params, Map additionalProperties) {
+ this.data = data;
+ this.params = params;
+ this.additionalProperties = additionalProperties;
+ }
+
+ @JsonProperty("data")
+ public CheckoutDataResponseData getData() {
+ return data;
+ }
+
+ /**
+ * @return Input parameters
+ */
+ @JsonProperty("params")
+ public Map getParams() {
+ return params;
+ }
+
+ @java.lang.Override
+ public boolean equals(Object other) {
+ if (this == other) return true;
+ return other instanceof GetCheckoutDataResponse && equalTo((GetCheckoutDataResponse) other);
+ }
+
+ @JsonAnyGetter
+ public Map getAdditionalProperties() {
+ return this.additionalProperties;
+ }
+
+ private boolean equalTo(GetCheckoutDataResponse other) {
+ return data.equals(other.data) && params.equals(other.params);
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ return Objects.hash(this.data, this.params);
+ }
+
+ @java.lang.Override
+ public String toString() {
+ return ObjectMappers.stringify(this);
+ }
+
+ public static DataStage builder() {
+ return new Builder();
+ }
+
+ public interface DataStage {
+ _FinalStage data(@NotNull CheckoutDataResponseData data);
+
+ Builder from(GetCheckoutDataResponse other);
+ }
+
+ public interface _FinalStage {
+ GetCheckoutDataResponse build();
+
+ _FinalStage params(Map params);
+
+ _FinalStage putAllParams(Map params);
+
+ _FinalStage params(String key, JsonNode value);
+ }
+
+ @JsonIgnoreProperties(ignoreUnknown = true)
+ public static final class Builder implements DataStage, _FinalStage {
+ private CheckoutDataResponseData data;
+
+ private Map params = new LinkedHashMap<>();
+
+ @JsonAnySetter
+ private Map additionalProperties = new HashMap<>();
+
+ private Builder() {}
+
+ @java.lang.Override
+ public Builder from(GetCheckoutDataResponse other) {
+ data(other.getData());
+ params(other.getParams());
+ return this;
+ }
+
+ @java.lang.Override
+ @JsonSetter("data")
+ public _FinalStage data(@NotNull CheckoutDataResponseData data) {
+ this.data = Objects.requireNonNull(data, "data must not be null");
+ return this;
+ }
+
+ /**
+ * Input parameters
+ * @return Reference to {@code this} so that method calls can be chained together.
+ */
+ @java.lang.Override
+ public _FinalStage params(String key, JsonNode value) {
+ this.params.put(key, value);
+ return this;
+ }
+
+ /**
+ * Input parameters
+ * @return Reference to {@code this} so that method calls can be chained together.
+ */
+ @java.lang.Override
+ public _FinalStage putAllParams(Map params) {
+ this.params.putAll(params);
+ return this;
+ }
+
+ @java.lang.Override
+ @JsonSetter(value = "params", nulls = Nulls.SKIP)
+ public _FinalStage params(Map params) {
+ this.params.clear();
+ this.params.putAll(params);
+ return this;
+ }
+
+ @java.lang.Override
+ public GetCheckoutDataResponse build() {
+ return new GetCheckoutDataResponse(data, params, additionalProperties);
+ }
+ }
+}
diff --git a/src/main/java/com/schematic/api/resources/components/ComponentsClient.java b/src/main/java/com/schematic/api/resources/components/ComponentsClient.java
index f556811..8984543 100644
--- a/src/main/java/com/schematic/api/resources/components/ComponentsClient.java
+++ b/src/main/java/com/schematic/api/resources/components/ComponentsClient.java
@@ -69,7 +69,8 @@ public ListComponentsResponse listComponents(ListComponentsRequest 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()) {
@@ -129,6 +130,7 @@ public CreateComponentResponse createComponent(CreateComponentRequestBody reques
.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()) {
@@ -182,6 +184,7 @@ public GetComponentResponse getComponent(String componentId, RequestOptions requ
.method("GET", 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()) {
@@ -220,6 +223,10 @@ public GetComponentResponse getComponent(String componentId, RequestOptions requ
}
}
+ public UpdateComponentResponse updateComponent(String componentId) {
+ return updateComponent(componentId, UpdateComponentRequestBody.builder().build());
+ }
+
public UpdateComponentResponse updateComponent(String componentId, UpdateComponentRequestBody request) {
return updateComponent(componentId, request, null);
}
@@ -243,6 +250,7 @@ public UpdateComponentResponse updateComponent(
.method("PUT", 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()) {
@@ -299,6 +307,7 @@ public DeleteComponentResponse deleteComponent(String componentId, RequestOption
.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()) {
@@ -362,7 +371,8 @@ public CountComponentsResponse countComponents(CountComponentsRequest request, 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()) {
@@ -424,7 +434,8 @@ public PreviewComponentDataResponse previewComponentData(
.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()) {
diff --git a/src/main/java/com/schematic/api/resources/crm/CrmClient.java b/src/main/java/com/schematic/api/resources/crm/CrmClient.java
index fde1ba8..337cdfe 100644
--- a/src/main/java/com/schematic/api/resources/crm/CrmClient.java
+++ b/src/main/java/com/schematic/api/resources/crm/CrmClient.java
@@ -64,6 +64,7 @@ public UpsertDealLineItemAssociationResponse upsertDealLineItemAssociation(
.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()) {
@@ -124,6 +125,7 @@ public UpsertLineItemResponse upsertLineItem(CreateCrmLineItemRequestBody reques
.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()) {
@@ -183,6 +185,7 @@ public UpsertCrmDealResponse upsertCrmDeal(CreateCrmDealRequestBody 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()) {
@@ -249,7 +252,8 @@ public ListCrmProductsResponse listCrmProducts(ListCrmProductsRequest request, 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()) {
@@ -310,6 +314,7 @@ public UpsertCrmProductResponse upsertCrmProduct(
.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()) {
diff --git a/src/main/java/com/schematic/api/resources/events/EventsClient.java b/src/main/java/com/schematic/api/resources/events/EventsClient.java
index e8d8851..e253a96 100644
--- a/src/main/java/com/schematic/api/resources/events/EventsClient.java
+++ b/src/main/java/com/schematic/api/resources/events/EventsClient.java
@@ -64,6 +64,7 @@ public CreateEventBatchResponse createEventBatch(
.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()) {
@@ -132,7 +133,8 @@ public GetEventSummariesResponse getEventSummaries(
.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()) {
@@ -208,7 +210,8 @@ public ListEventsResponse listEvents(ListEventsRequest 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()) {
@@ -268,6 +271,7 @@ public CreateEventResponse createEvent(CreateEventRequestBody request, RequestOp
.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()) {
@@ -321,6 +325,7 @@ public GetEventResponse getEvent(String eventId, RequestOptions requestOptions)
.method("GET", 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()) {
@@ -373,6 +378,7 @@ public GetSegmentIntegrationStatusResponse getSegmentIntegrationStatus(RequestOp
.method("GET", 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()) {
diff --git a/src/main/java/com/schematic/api/resources/features/FeaturesClient.java b/src/main/java/com/schematic/api/resources/features/FeaturesClient.java
index 37ede56..53d8882 100644
--- a/src/main/java/com/schematic/api/resources/features/FeaturesClient.java
+++ b/src/main/java/com/schematic/api/resources/features/FeaturesClient.java
@@ -83,6 +83,7 @@ public CountAudienceCompaniesResponse countAudienceCompanies(
.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()) {
@@ -142,6 +143,7 @@ public CountAudienceUsersResponse countAudienceUsers(AudienceRequestBody request
.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()) {
@@ -202,6 +204,7 @@ public ListAudienceCompaniesResponse listAudienceCompanies(
.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()) {
@@ -261,6 +264,7 @@ public ListAudienceUsersResponse listAudienceUsers(AudienceRequestBody request,
.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()) {
@@ -337,7 +341,8 @@ public ListFeaturesResponse listFeatures(ListFeaturesRequest 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()) {
@@ -397,6 +402,7 @@ public CreateFeatureResponse createFeature(CreateFeatureRequestBody 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()) {
@@ -450,6 +456,7 @@ public GetFeatureResponse getFeature(String featureId, RequestOptions requestOpt
.method("GET", 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()) {
@@ -488,6 +495,10 @@ public GetFeatureResponse getFeature(String featureId, RequestOptions requestOpt
}
}
+ public UpdateFeatureResponse updateFeature(String featureId) {
+ return updateFeature(featureId, UpdateFeatureRequestBody.builder().build());
+ }
+
public UpdateFeatureResponse updateFeature(String featureId, UpdateFeatureRequestBody request) {
return updateFeature(featureId, request, null);
}
@@ -511,6 +522,7 @@ public UpdateFeatureResponse updateFeature(
.method("PUT", 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()) {
@@ -567,6 +579,7 @@ public DeleteFeatureResponse deleteFeature(String featureId, RequestOptions requ
.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()) {
@@ -643,7 +656,8 @@ public CountFeaturesResponse countFeatures(CountFeaturesRequest 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()) {
@@ -713,7 +727,8 @@ public ListFlagsResponse listFlags(ListFlagsRequest request, RequestOptions 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()) {
@@ -773,6 +788,7 @@ public CreateFlagResponse createFlag(CreateFlagRequestBody request, RequestOptio
.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()) {
@@ -826,6 +842,7 @@ public GetFlagResponse getFlag(String flagId, RequestOptions requestOptions) {
.method("GET", 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()) {
@@ -886,6 +903,7 @@ public UpdateFlagResponse updateFlag(String flagId, CreateFlagRequestBody reques
.method("PUT", 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()) {
@@ -942,6 +960,7 @@ public DeleteFlagResponse deleteFlag(String flagId, RequestOptions requestOption
.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()) {
@@ -1004,6 +1023,7 @@ public UpdateFlagRulesResponse updateFlagRules(
.method("PUT", 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()) {
@@ -1072,6 +1092,7 @@ public CheckFlagResponse checkFlag(String key, CheckFlagRequestBody 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()) {
@@ -1135,6 +1156,7 @@ public CheckFlagsResponse checkFlags(CheckFlagRequestBody request, RequestOption
.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()) {
@@ -1204,7 +1226,8 @@ public CountFlagsResponse countFlags(CountFlagsRequest 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()) {
diff --git a/src/main/java/com/schematic/api/resources/plangroups/PlangroupsClient.java b/src/main/java/com/schematic/api/resources/plangroups/PlangroupsClient.java
index a21ef0b..b9465b6 100644
--- a/src/main/java/com/schematic/api/resources/plangroups/PlangroupsClient.java
+++ b/src/main/java/com/schematic/api/resources/plangroups/PlangroupsClient.java
@@ -51,6 +51,7 @@ public GetPlanGroupResponse getPlanGroup(RequestOptions requestOptions) {
.method("GET", 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()) {
@@ -110,6 +111,7 @@ public CreatePlanGroupResponse createPlanGroup(CreatePlanGroupRequestBody reques
.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()) {
@@ -171,6 +173,7 @@ public UpdatePlanGroupResponse updatePlanGroup(
.method("PUT", 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()) {
diff --git a/src/main/java/com/schematic/api/resources/plans/PlansClient.java b/src/main/java/com/schematic/api/resources/plans/PlansClient.java
index bfa9075..845ec8b 100644
--- a/src/main/java/com/schematic/api/resources/plans/PlansClient.java
+++ b/src/main/java/com/schematic/api/resources/plans/PlansClient.java
@@ -19,6 +19,7 @@
import com.schematic.api.resources.plans.requests.CreatePlanRequestBody;
import com.schematic.api.resources.plans.requests.ListPlansRequest;
import com.schematic.api.resources.plans.requests.UpdateAudienceRequestBody;
+import com.schematic.api.resources.plans.requests.UpdateCompanyPlansRequestBody;
import com.schematic.api.resources.plans.requests.UpdatePlanRequestBody;
import com.schematic.api.resources.plans.requests.UpsertBillingProductRequestBody;
import com.schematic.api.resources.plans.types.CountPlansResponse;
@@ -29,6 +30,7 @@
import com.schematic.api.resources.plans.types.GetPlanResponse;
import com.schematic.api.resources.plans.types.ListPlansResponse;
import com.schematic.api.resources.plans.types.UpdateAudienceResponse;
+import com.schematic.api.resources.plans.types.UpdateCompanyPlansResponse;
import com.schematic.api.resources.plans.types.UpdatePlanResponse;
import com.schematic.api.resources.plans.types.UpsertBillingProductPlanResponse;
import com.schematic.api.types.ApiError;
@@ -48,6 +50,71 @@ public PlansClient(ClientOptions clientOptions) {
this.clientOptions = clientOptions;
}
+ public UpdateCompanyPlansResponse updateCompanyPlans(String companyPlanId, UpdateCompanyPlansRequestBody request) {
+ return updateCompanyPlans(companyPlanId, request, null);
+ }
+
+ public UpdateCompanyPlansResponse updateCompanyPlans(
+ String companyPlanId, UpdateCompanyPlansRequestBody request, RequestOptions requestOptions) {
+ HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ .newBuilder()
+ .addPathSegments("company-plans")
+ .addPathSegment(companyPlanId)
+ .build();
+ RequestBody body;
+ try {
+ body = RequestBody.create(
+ ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON);
+ } catch (JsonProcessingException e) {
+ throw new BaseSchematicException("Failed to serialize request", e);
+ }
+ Request okhttpRequest = new Request.Builder()
+ .url(httpUrl)
+ .method("PUT", 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()) {
+ client = clientOptions.httpClientWithTimeout(requestOptions);
+ }
+ try (Response response = client.newCall(okhttpRequest).execute()) {
+ ResponseBody responseBody = response.body();
+ if (response.isSuccessful()) {
+ return ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), UpdateCompanyPlansResponse.class);
+ }
+ String responseBodyString = responseBody != null ? responseBody.string() : "{}";
+ try {
+ switch (response.code()) {
+ case 400:
+ throw new BadRequestError(
+ ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ApiError.class));
+ case 401:
+ throw new UnauthorizedError(
+ ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ApiError.class));
+ case 403:
+ throw new ForbiddenError(
+ ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ApiError.class));
+ case 404:
+ throw new NotFoundError(
+ ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ApiError.class));
+ case 500:
+ throw new InternalServerError(
+ ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ApiError.class));
+ }
+ } catch (JsonProcessingException ignored) {
+ // unable to map error response, throwing generic error
+ }
+ throw new BaseSchematicApiException(
+ "Error with status code " + response.code(),
+ response.code(),
+ ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class));
+ } catch (IOException e) {
+ throw new BaseSchematicException("Network error executing HTTP request", e);
+ }
+ }
+
public GetAudienceResponse getAudience(String planAudienceId) {
return getAudience(planAudienceId, null);
}
@@ -63,6 +130,7 @@ public GetAudienceResponse getAudience(String planAudienceId, RequestOptions req
.method("GET", 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()) {
@@ -124,6 +192,7 @@ public UpdateAudienceResponse updateAudience(
.method("PUT", 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()) {
@@ -180,6 +249,7 @@ public DeleteAudienceResponse deleteAudience(String planAudienceId, RequestOptio
.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()) {
@@ -255,6 +325,11 @@ public ListPlansResponse listPlans(ListPlansRequest request, RequestOptions requ
httpUrl.addQueryParameter(
"without_product_id", request.getWithoutProductId().get().toString());
}
+ if (request.getWithoutPaidProductId().isPresent()) {
+ httpUrl.addQueryParameter(
+ "without_paid_product_id",
+ request.getWithoutPaidProductId().get().toString());
+ }
if (request.getLimit().isPresent()) {
httpUrl.addQueryParameter("limit", request.getLimit().get().toString());
}
@@ -265,7 +340,8 @@ public ListPlansResponse listPlans(ListPlansRequest request, RequestOptions 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()) {
@@ -325,6 +401,7 @@ public CreatePlanResponse createPlan(CreatePlanRequestBody request, RequestOptio
.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()) {
@@ -378,6 +455,7 @@ public GetPlanResponse getPlan(String planId, RequestOptions requestOptions) {
.method("GET", 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()) {
@@ -438,6 +516,7 @@ public UpdatePlanResponse updatePlan(String planId, UpdatePlanRequestBody reques
.method("PUT", 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()) {
@@ -494,6 +573,7 @@ public DeletePlanResponse deletePlan(String planId, RequestOptions requestOption
.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()) {
@@ -557,6 +637,7 @@ public UpsertBillingProductPlanResponse upsertBillingProductPlan(
.method("PUT", 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()) {
@@ -636,6 +717,11 @@ public CountPlansResponse countPlans(CountPlansRequest request, RequestOptions r
httpUrl.addQueryParameter(
"without_product_id", request.getWithoutProductId().get().toString());
}
+ if (request.getWithoutPaidProductId().isPresent()) {
+ httpUrl.addQueryParameter(
+ "without_paid_product_id",
+ request.getWithoutPaidProductId().get().toString());
+ }
if (request.getLimit().isPresent()) {
httpUrl.addQueryParameter("limit", request.getLimit().get().toString());
}
@@ -646,7 +732,8 @@ public CountPlansResponse countPlans(CountPlansRequest 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()) {
diff --git a/src/main/java/com/schematic/api/resources/plans/requests/CountPlansRequest.java b/src/main/java/com/schematic/api/resources/plans/requests/CountPlansRequest.java
index dfd6418..f674dc9 100644
--- a/src/main/java/com/schematic/api/resources/plans/requests/CountPlansRequest.java
+++ b/src/main/java/com/schematic/api/resources/plans/requests/CountPlansRequest.java
@@ -35,6 +35,8 @@ public final class CountPlansRequest {
private final Optional withoutProductId;
+ private final Optional withoutPaidProductId;
+
private final Optional limit;
private final Optional offset;
@@ -49,6 +51,7 @@ private CountPlansRequest(
Optional q,
Optional withoutEntitlementFor,
Optional withoutProductId,
+ Optional withoutPaidProductId,
Optional limit,
Optional offset,
Map additionalProperties) {
@@ -59,6 +62,7 @@ private CountPlansRequest(
this.q = q;
this.withoutEntitlementFor = withoutEntitlementFor;
this.withoutProductId = withoutProductId;
+ this.withoutPaidProductId = withoutPaidProductId;
this.limit = limit;
this.offset = offset;
this.additionalProperties = additionalProperties;
@@ -111,6 +115,14 @@ public Optional getWithoutProductId() {
return withoutProductId;
}
+ /**
+ * @return Filter out plans that have a paid billing product ID
+ */
+ @JsonProperty("without_paid_product_id")
+ public Optional getWithoutPaidProductId() {
+ return withoutPaidProductId;
+ }
+
/**
* @return Page limit (default 100)
*/
@@ -146,6 +158,7 @@ private boolean equalTo(CountPlansRequest other) {
&& q.equals(other.q)
&& withoutEntitlementFor.equals(other.withoutEntitlementFor)
&& withoutProductId.equals(other.withoutProductId)
+ && withoutPaidProductId.equals(other.withoutPaidProductId)
&& limit.equals(other.limit)
&& offset.equals(other.offset);
}
@@ -160,6 +173,7 @@ public int hashCode() {
this.q,
this.withoutEntitlementFor,
this.withoutProductId,
+ this.withoutPaidProductId,
this.limit,
this.offset);
}
@@ -189,6 +203,8 @@ public static final class Builder {
private Optional withoutProductId = Optional.empty();
+ private Optional withoutPaidProductId = Optional.empty();
+
private Optional limit = Optional.empty();
private Optional offset = Optional.empty();
@@ -206,6 +222,7 @@ public Builder from(CountPlansRequest other) {
q(other.getQ());
withoutEntitlementFor(other.getWithoutEntitlementFor());
withoutProductId(other.getWithoutProductId());
+ withoutPaidProductId(other.getWithoutPaidProductId());
limit(other.getLimit());
offset(other.getOffset());
return this;
@@ -288,6 +305,17 @@ public Builder withoutProductId(Boolean withoutProductId) {
return this;
}
+ @JsonSetter(value = "without_paid_product_id", nulls = Nulls.SKIP)
+ public Builder withoutPaidProductId(Optional withoutPaidProductId) {
+ this.withoutPaidProductId = withoutPaidProductId;
+ return this;
+ }
+
+ public Builder withoutPaidProductId(Boolean withoutPaidProductId) {
+ this.withoutPaidProductId = Optional.ofNullable(withoutPaidProductId);
+ return this;
+ }
+
@JsonSetter(value = "limit", nulls = Nulls.SKIP)
public Builder limit(Optional limit) {
this.limit = limit;
@@ -319,6 +347,7 @@ public CountPlansRequest build() {
q,
withoutEntitlementFor,
withoutProductId,
+ withoutPaidProductId,
limit,
offset,
additionalProperties);
diff --git a/src/main/java/com/schematic/api/resources/plans/requests/ListPlansRequest.java b/src/main/java/com/schematic/api/resources/plans/requests/ListPlansRequest.java
index cc4b8e3..d2330ad 100644
--- a/src/main/java/com/schematic/api/resources/plans/requests/ListPlansRequest.java
+++ b/src/main/java/com/schematic/api/resources/plans/requests/ListPlansRequest.java
@@ -35,6 +35,8 @@ public final class ListPlansRequest {
private final Optional withoutProductId;
+ private final Optional withoutPaidProductId;
+
private final Optional limit;
private final Optional offset;
@@ -49,6 +51,7 @@ private ListPlansRequest(
Optional q,
Optional withoutEntitlementFor,
Optional withoutProductId,
+ Optional withoutPaidProductId,
Optional limit,
Optional offset,
Map additionalProperties) {
@@ -59,6 +62,7 @@ private ListPlansRequest(
this.q = q;
this.withoutEntitlementFor = withoutEntitlementFor;
this.withoutProductId = withoutProductId;
+ this.withoutPaidProductId = withoutPaidProductId;
this.limit = limit;
this.offset = offset;
this.additionalProperties = additionalProperties;
@@ -111,6 +115,14 @@ public Optional getWithoutProductId() {
return withoutProductId;
}
+ /**
+ * @return Filter out plans that have a paid billing product ID
+ */
+ @JsonProperty("without_paid_product_id")
+ public Optional getWithoutPaidProductId() {
+ return withoutPaidProductId;
+ }
+
/**
* @return Page limit (default 100)
*/
@@ -146,6 +158,7 @@ private boolean equalTo(ListPlansRequest other) {
&& q.equals(other.q)
&& withoutEntitlementFor.equals(other.withoutEntitlementFor)
&& withoutProductId.equals(other.withoutProductId)
+ && withoutPaidProductId.equals(other.withoutPaidProductId)
&& limit.equals(other.limit)
&& offset.equals(other.offset);
}
@@ -160,6 +173,7 @@ public int hashCode() {
this.q,
this.withoutEntitlementFor,
this.withoutProductId,
+ this.withoutPaidProductId,
this.limit,
this.offset);
}
@@ -189,6 +203,8 @@ public static final class Builder {
private Optional withoutProductId = Optional.empty();
+ private Optional withoutPaidProductId = Optional.empty();
+
private Optional limit = Optional.empty();
private Optional offset = Optional.empty();
@@ -206,6 +222,7 @@ public Builder from(ListPlansRequest other) {
q(other.getQ());
withoutEntitlementFor(other.getWithoutEntitlementFor());
withoutProductId(other.getWithoutProductId());
+ withoutPaidProductId(other.getWithoutPaidProductId());
limit(other.getLimit());
offset(other.getOffset());
return this;
@@ -288,6 +305,17 @@ public Builder withoutProductId(Boolean withoutProductId) {
return this;
}
+ @JsonSetter(value = "without_paid_product_id", nulls = Nulls.SKIP)
+ public Builder withoutPaidProductId(Optional withoutPaidProductId) {
+ this.withoutPaidProductId = withoutPaidProductId;
+ return this;
+ }
+
+ public Builder withoutPaidProductId(Boolean withoutPaidProductId) {
+ this.withoutPaidProductId = Optional.ofNullable(withoutPaidProductId);
+ return this;
+ }
+
@JsonSetter(value = "limit", nulls = Nulls.SKIP)
public Builder limit(Optional limit) {
this.limit = limit;
@@ -319,6 +347,7 @@ public ListPlansRequest build() {
q,
withoutEntitlementFor,
withoutProductId,
+ withoutPaidProductId,
limit,
offset,
additionalProperties);
diff --git a/src/main/java/com/schematic/api/resources/plans/requests/UpdateCompanyPlansRequestBody.java b/src/main/java/com/schematic/api/resources/plans/requests/UpdateCompanyPlansRequestBody.java
new file mode 100644
index 0000000..318023e
--- /dev/null
+++ b/src/main/java/com/schematic/api/resources/plans/requests/UpdateCompanyPlansRequestBody.java
@@ -0,0 +1,126 @@
+/**
+ * This file was auto-generated by Fern from our API Definition.
+ */
+package com.schematic.api.resources.plans.requests;
+
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonSetter;
+import com.fasterxml.jackson.annotation.Nulls;
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import com.schematic.api.core.ObjectMappers;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Optional;
+
+@JsonInclude(JsonInclude.Include.NON_ABSENT)
+@JsonDeserialize(builder = UpdateCompanyPlansRequestBody.Builder.class)
+public final class UpdateCompanyPlansRequestBody {
+ private final List addOnIds;
+
+ private final Optional basePlanId;
+
+ private final Map additionalProperties;
+
+ private UpdateCompanyPlansRequestBody(
+ List addOnIds, Optional basePlanId, Map additionalProperties) {
+ this.addOnIds = addOnIds;
+ this.basePlanId = basePlanId;
+ this.additionalProperties = additionalProperties;
+ }
+
+ @JsonProperty("add_on_ids")
+ public List getAddOnIds() {
+ return addOnIds;
+ }
+
+ @JsonProperty("base_plan_id")
+ public Optional getBasePlanId() {
+ return basePlanId;
+ }
+
+ @java.lang.Override
+ public boolean equals(Object other) {
+ if (this == other) return true;
+ return other instanceof UpdateCompanyPlansRequestBody && equalTo((UpdateCompanyPlansRequestBody) other);
+ }
+
+ @JsonAnyGetter
+ public Map getAdditionalProperties() {
+ return this.additionalProperties;
+ }
+
+ private boolean equalTo(UpdateCompanyPlansRequestBody other) {
+ return addOnIds.equals(other.addOnIds) && basePlanId.equals(other.basePlanId);
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ return Objects.hash(this.addOnIds, this.basePlanId);
+ }
+
+ @java.lang.Override
+ public String toString() {
+ return ObjectMappers.stringify(this);
+ }
+
+ public static Builder builder() {
+ return new Builder();
+ }
+
+ @JsonIgnoreProperties(ignoreUnknown = true)
+ public static final class Builder {
+ private List addOnIds = new ArrayList<>();
+
+ private Optional basePlanId = Optional.empty();
+
+ @JsonAnySetter
+ private Map additionalProperties = new HashMap<>();
+
+ private Builder() {}
+
+ public Builder from(UpdateCompanyPlansRequestBody other) {
+ addOnIds(other.getAddOnIds());
+ basePlanId(other.getBasePlanId());
+ return this;
+ }
+
+ @JsonSetter(value = "add_on_ids", nulls = Nulls.SKIP)
+ public Builder addOnIds(List addOnIds) {
+ this.addOnIds.clear();
+ this.addOnIds.addAll(addOnIds);
+ return this;
+ }
+
+ public Builder addAddOnIds(String addOnIds) {
+ this.addOnIds.add(addOnIds);
+ return this;
+ }
+
+ public Builder addAllAddOnIds(List addOnIds) {
+ this.addOnIds.addAll(addOnIds);
+ return this;
+ }
+
+ @JsonSetter(value = "base_plan_id", nulls = Nulls.SKIP)
+ public Builder basePlanId(Optional basePlanId) {
+ this.basePlanId = basePlanId;
+ return this;
+ }
+
+ public Builder basePlanId(String basePlanId) {
+ this.basePlanId = Optional.ofNullable(basePlanId);
+ return this;
+ }
+
+ public UpdateCompanyPlansRequestBody build() {
+ return new UpdateCompanyPlansRequestBody(addOnIds, basePlanId, additionalProperties);
+ }
+ }
+}
diff --git a/src/main/java/com/schematic/api/resources/plans/types/CountPlansParams.java b/src/main/java/com/schematic/api/resources/plans/types/CountPlansParams.java
index eda8e7a..c7d73ef 100644
--- a/src/main/java/com/schematic/api/resources/plans/types/CountPlansParams.java
+++ b/src/main/java/com/schematic/api/resources/plans/types/CountPlansParams.java
@@ -37,6 +37,8 @@ public final class CountPlansParams {
private final Optional withoutEntitlementFor;
+ private final Optional withoutPaidProductId;
+
private final Optional withoutProductId;
private final Map additionalProperties;
@@ -50,6 +52,7 @@ private CountPlansParams(
Optional planType,
Optional q,
Optional withoutEntitlementFor,
+ Optional withoutPaidProductId,
Optional withoutProductId,
Map additionalProperties) {
this.companyId = companyId;
@@ -60,6 +63,7 @@ private CountPlansParams(
this.planType = planType;
this.q = q;
this.withoutEntitlementFor = withoutEntitlementFor;
+ this.withoutPaidProductId = withoutPaidProductId;
this.withoutProductId = withoutProductId;
this.additionalProperties = additionalProperties;
}
@@ -119,6 +123,14 @@ public Optional getWithoutEntitlementFor() {
return withoutEntitlementFor;
}
+ /**
+ * @return Filter out plans that have a paid billing product ID
+ */
+ @JsonProperty("without_paid_product_id")
+ public Optional getWithoutPaidProductId() {
+ return withoutPaidProductId;
+ }
+
/**
* @return Filter out plans that have a billing product ID
*/
@@ -147,6 +159,7 @@ private boolean equalTo(CountPlansParams other) {
&& planType.equals(other.planType)
&& q.equals(other.q)
&& withoutEntitlementFor.equals(other.withoutEntitlementFor)
+ && withoutPaidProductId.equals(other.withoutPaidProductId)
&& withoutProductId.equals(other.withoutProductId);
}
@@ -161,6 +174,7 @@ public int hashCode() {
this.planType,
this.q,
this.withoutEntitlementFor,
+ this.withoutPaidProductId,
this.withoutProductId);
}
@@ -191,6 +205,8 @@ public static final class Builder {
private Optional withoutEntitlementFor = Optional.empty();
+ private Optional withoutPaidProductId = Optional.empty();
+
private Optional withoutProductId = Optional.empty();
@JsonAnySetter
@@ -207,6 +223,7 @@ public Builder from(CountPlansParams other) {
planType(other.getPlanType());
q(other.getQ());
withoutEntitlementFor(other.getWithoutEntitlementFor());
+ withoutPaidProductId(other.getWithoutPaidProductId());
withoutProductId(other.getWithoutProductId());
return this;
}
@@ -299,6 +316,17 @@ public Builder withoutEntitlementFor(String withoutEntitlementFor) {
return this;
}
+ @JsonSetter(value = "without_paid_product_id", nulls = Nulls.SKIP)
+ public Builder withoutPaidProductId(Optional withoutPaidProductId) {
+ this.withoutPaidProductId = withoutPaidProductId;
+ return this;
+ }
+
+ public Builder withoutPaidProductId(Boolean withoutPaidProductId) {
+ this.withoutPaidProductId = Optional.ofNullable(withoutPaidProductId);
+ return this;
+ }
+
@JsonSetter(value = "without_product_id", nulls = Nulls.SKIP)
public Builder withoutProductId(Optional withoutProductId) {
this.withoutProductId = withoutProductId;
@@ -320,6 +348,7 @@ public CountPlansParams build() {
planType,
q,
withoutEntitlementFor,
+ withoutPaidProductId,
withoutProductId,
additionalProperties);
}
diff --git a/src/main/java/com/schematic/api/resources/plans/types/ListPlansParams.java b/src/main/java/com/schematic/api/resources/plans/types/ListPlansParams.java
index bc898a0..c1c57ab 100644
--- a/src/main/java/com/schematic/api/resources/plans/types/ListPlansParams.java
+++ b/src/main/java/com/schematic/api/resources/plans/types/ListPlansParams.java
@@ -37,6 +37,8 @@ public final class ListPlansParams {
private final Optional withoutEntitlementFor;
+ private final Optional withoutPaidProductId;
+
private final Optional withoutProductId;
private final Map additionalProperties;
@@ -50,6 +52,7 @@ private ListPlansParams(
Optional planType,
Optional q,
Optional withoutEntitlementFor,
+ Optional withoutPaidProductId,
Optional withoutProductId,
Map additionalProperties) {
this.companyId = companyId;
@@ -60,6 +63,7 @@ private ListPlansParams(
this.planType = planType;
this.q = q;
this.withoutEntitlementFor = withoutEntitlementFor;
+ this.withoutPaidProductId = withoutPaidProductId;
this.withoutProductId = withoutProductId;
this.additionalProperties = additionalProperties;
}
@@ -119,6 +123,14 @@ public Optional getWithoutEntitlementFor() {
return withoutEntitlementFor;
}
+ /**
+ * @return Filter out plans that have a paid billing product ID
+ */
+ @JsonProperty("without_paid_product_id")
+ public Optional getWithoutPaidProductId() {
+ return withoutPaidProductId;
+ }
+
/**
* @return Filter out plans that have a billing product ID
*/
@@ -147,6 +159,7 @@ private boolean equalTo(ListPlansParams other) {
&& planType.equals(other.planType)
&& q.equals(other.q)
&& withoutEntitlementFor.equals(other.withoutEntitlementFor)
+ && withoutPaidProductId.equals(other.withoutPaidProductId)
&& withoutProductId.equals(other.withoutProductId);
}
@@ -161,6 +174,7 @@ public int hashCode() {
this.planType,
this.q,
this.withoutEntitlementFor,
+ this.withoutPaidProductId,
this.withoutProductId);
}
@@ -191,6 +205,8 @@ public static final class Builder {
private Optional withoutEntitlementFor = Optional.empty();
+ private Optional withoutPaidProductId = Optional.empty();
+
private Optional withoutProductId = Optional.empty();
@JsonAnySetter
@@ -207,6 +223,7 @@ public Builder from(ListPlansParams other) {
planType(other.getPlanType());
q(other.getQ());
withoutEntitlementFor(other.getWithoutEntitlementFor());
+ withoutPaidProductId(other.getWithoutPaidProductId());
withoutProductId(other.getWithoutProductId());
return this;
}
@@ -299,6 +316,17 @@ public Builder withoutEntitlementFor(String withoutEntitlementFor) {
return this;
}
+ @JsonSetter(value = "without_paid_product_id", nulls = Nulls.SKIP)
+ public Builder withoutPaidProductId(Optional withoutPaidProductId) {
+ this.withoutPaidProductId = withoutPaidProductId;
+ return this;
+ }
+
+ public Builder withoutPaidProductId(Boolean withoutPaidProductId) {
+ this.withoutPaidProductId = Optional.ofNullable(withoutPaidProductId);
+ return this;
+ }
+
@JsonSetter(value = "without_product_id", nulls = Nulls.SKIP)
public Builder withoutProductId(Optional withoutProductId) {
this.withoutProductId = withoutProductId;
@@ -320,6 +348,7 @@ public ListPlansParams build() {
planType,
q,
withoutEntitlementFor,
+ withoutPaidProductId,
withoutProductId,
additionalProperties);
}
diff --git a/src/main/java/com/schematic/api/resources/plans/types/UpdateCompanyPlansResponse.java b/src/main/java/com/schematic/api/resources/plans/types/UpdateCompanyPlansResponse.java
new file mode 100644
index 0000000..f03027e
--- /dev/null
+++ b/src/main/java/com/schematic/api/resources/plans/types/UpdateCompanyPlansResponse.java
@@ -0,0 +1,155 @@
+/**
+ * This file was auto-generated by Fern from our API Definition.
+ */
+package com.schematic.api.resources.plans.types;
+
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonSetter;
+import com.fasterxml.jackson.annotation.Nulls;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import com.schematic.api.core.ObjectMappers;
+import com.schematic.api.types.CompanyDetailResponseData;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.Objects;
+import org.jetbrains.annotations.NotNull;
+
+@JsonInclude(JsonInclude.Include.NON_ABSENT)
+@JsonDeserialize(builder = UpdateCompanyPlansResponse.Builder.class)
+public final class UpdateCompanyPlansResponse {
+ private final CompanyDetailResponseData data;
+
+ private final Map params;
+
+ private final Map additionalProperties;
+
+ private UpdateCompanyPlansResponse(
+ CompanyDetailResponseData data, Map params, Map additionalProperties) {
+ this.data = data;
+ this.params = params;
+ this.additionalProperties = additionalProperties;
+ }
+
+ @JsonProperty("data")
+ public CompanyDetailResponseData getData() {
+ return data;
+ }
+
+ /**
+ * @return Input parameters
+ */
+ @JsonProperty("params")
+ public Map getParams() {
+ return params;
+ }
+
+ @java.lang.Override
+ public boolean equals(Object other) {
+ if (this == other) return true;
+ return other instanceof UpdateCompanyPlansResponse && equalTo((UpdateCompanyPlansResponse) other);
+ }
+
+ @JsonAnyGetter
+ public Map getAdditionalProperties() {
+ return this.additionalProperties;
+ }
+
+ private boolean equalTo(UpdateCompanyPlansResponse other) {
+ return data.equals(other.data) && params.equals(other.params);
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ return Objects.hash(this.data, this.params);
+ }
+
+ @java.lang.Override
+ public String toString() {
+ return ObjectMappers.stringify(this);
+ }
+
+ public static DataStage builder() {
+ return new Builder();
+ }
+
+ public interface DataStage {
+ _FinalStage data(@NotNull CompanyDetailResponseData data);
+
+ Builder from(UpdateCompanyPlansResponse other);
+ }
+
+ public interface _FinalStage {
+ UpdateCompanyPlansResponse build();
+
+ _FinalStage params(Map params);
+
+ _FinalStage putAllParams(Map params);
+
+ _FinalStage params(String key, JsonNode value);
+ }
+
+ @JsonIgnoreProperties(ignoreUnknown = true)
+ public static final class Builder implements DataStage, _FinalStage {
+ private CompanyDetailResponseData data;
+
+ private Map params = new LinkedHashMap<>();
+
+ @JsonAnySetter
+ private Map additionalProperties = new HashMap<>();
+
+ private Builder() {}
+
+ @java.lang.Override
+ public Builder from(UpdateCompanyPlansResponse other) {
+ data(other.getData());
+ params(other.getParams());
+ return this;
+ }
+
+ @java.lang.Override
+ @JsonSetter("data")
+ public _FinalStage data(@NotNull CompanyDetailResponseData data) {
+ this.data = Objects.requireNonNull(data, "data must not be null");
+ return this;
+ }
+
+ /**
+ * Input parameters
+ * @return Reference to {@code this} so that method calls can be chained together.
+ */
+ @java.lang.Override
+ public _FinalStage params(String key, JsonNode value) {
+ this.params.put(key, value);
+ return this;
+ }
+
+ /**
+ * Input parameters
+ * @return Reference to {@code this} so that method calls can be chained together.
+ */
+ @java.lang.Override
+ public _FinalStage putAllParams(Map params) {
+ this.params.putAll(params);
+ return this;
+ }
+
+ @java.lang.Override
+ @JsonSetter(value = "params", nulls = Nulls.SKIP)
+ public _FinalStage params(Map params) {
+ this.params.clear();
+ this.params.putAll(params);
+ return this;
+ }
+
+ @java.lang.Override
+ public UpdateCompanyPlansResponse build() {
+ return new UpdateCompanyPlansResponse(data, params, additionalProperties);
+ }
+ }
+}
diff --git a/src/main/java/com/schematic/api/resources/webhooks/WebhooksClient.java b/src/main/java/com/schematic/api/resources/webhooks/WebhooksClient.java
index 3106edf..093a786 100644
--- a/src/main/java/com/schematic/api/resources/webhooks/WebhooksClient.java
+++ b/src/main/java/com/schematic/api/resources/webhooks/WebhooksClient.java
@@ -79,7 +79,8 @@ public ListWebhookEventsResponse listWebhookEvents(
.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()) {
@@ -133,6 +134,7 @@ public GetWebhookEventResponse getWebhookEvent(String webhookEventId, RequestOpt
.method("GET", 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()) {
@@ -203,7 +205,8 @@ public CountWebhookEventsResponse countWebhookEvents(
.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()) {
@@ -267,7 +270,8 @@ public ListWebhooksResponse listWebhooks(ListWebhooksRequest 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()) {
@@ -327,6 +331,7 @@ public CreateWebhookResponse createWebhook(CreateWebhookRequestBody 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()) {
@@ -380,6 +385,7 @@ public GetWebhookResponse getWebhook(String webhookId, RequestOptions requestOpt
.method("GET", 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()) {
@@ -418,6 +424,10 @@ public GetWebhookResponse getWebhook(String webhookId, RequestOptions requestOpt
}
}
+ public UpdateWebhookResponse updateWebhook(String webhookId) {
+ return updateWebhook(webhookId, UpdateWebhookRequestBody.builder().build());
+ }
+
public UpdateWebhookResponse updateWebhook(String webhookId, UpdateWebhookRequestBody request) {
return updateWebhook(webhookId, request, null);
}
@@ -441,6 +451,7 @@ public UpdateWebhookResponse updateWebhook(
.method("PUT", 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()) {
@@ -497,6 +508,7 @@ public DeleteWebhookResponse deleteWebhook(String webhookId, RequestOptions requ
.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()) {
@@ -560,7 +572,8 @@ public CountWebhooksResponse countWebhooks(CountWebhooksRequest 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()) {
diff --git a/src/main/java/com/schematic/api/resources/webhooks/types/CreateWebhookRequestBodyRequestTypesItem.java b/src/main/java/com/schematic/api/resources/webhooks/types/CreateWebhookRequestBodyRequestTypesItem.java
index bb4757d..adc3bd1 100644
--- a/src/main/java/com/schematic/api/resources/webhooks/types/CreateWebhookRequestBodyRequestTypesItem.java
+++ b/src/main/java/com/schematic/api/resources/webhooks/types/CreateWebhookRequestBodyRequestTypesItem.java
@@ -50,7 +50,9 @@ public enum CreateWebhookRequestBodyRequestTypesItem {
FLAG_DELETED("flag.deleted"),
- TEST_SEND("test.send");
+ TEST_SEND("test.send"),
+
+ SUBSCRIPTION_TRIAL_ENDED("subscription.trial.ended");
private final String value;
diff --git a/src/main/java/com/schematic/api/resources/webhooks/types/UpdateWebhookRequestBodyRequestTypesItem.java b/src/main/java/com/schematic/api/resources/webhooks/types/UpdateWebhookRequestBodyRequestTypesItem.java
index d881ae6..426ae36 100644
--- a/src/main/java/com/schematic/api/resources/webhooks/types/UpdateWebhookRequestBodyRequestTypesItem.java
+++ b/src/main/java/com/schematic/api/resources/webhooks/types/UpdateWebhookRequestBodyRequestTypesItem.java
@@ -50,7 +50,9 @@ public enum UpdateWebhookRequestBodyRequestTypesItem {
FLAG_DELETED("flag.deleted"),
- TEST_SEND("test.send");
+ TEST_SEND("test.send"),
+
+ SUBSCRIPTION_TRIAL_ENDED("subscription.trial.ended");
private final String value;
diff --git a/src/main/java/com/schematic/api/types/BillingPriceView.java b/src/main/java/com/schematic/api/types/BillingPriceView.java
index fa589f2..9436d2d 100644
--- a/src/main/java/com/schematic/api/types/BillingPriceView.java
+++ b/src/main/java/com/schematic/api/types/BillingPriceView.java
@@ -30,6 +30,8 @@ public final class BillingPriceView {
private final String interval;
+ private final boolean isActive;
+
private final Optional meterId;
private final int price;
@@ -55,6 +57,7 @@ private BillingPriceView(
String currency,
String id,
String interval,
+ boolean isActive,
Optional meterId,
int price,
String priceExternalId,
@@ -69,6 +72,7 @@ private BillingPriceView(
this.currency = currency;
this.id = id;
this.interval = interval;
+ this.isActive = isActive;
this.meterId = meterId;
this.price = price;
this.priceExternalId = priceExternalId;
@@ -101,6 +105,11 @@ public String getInterval() {
return interval;
}
+ @JsonProperty("is_active")
+ public boolean getIsActive() {
+ return isActive;
+ }
+
@JsonProperty("meter_id")
public Optional getMeterId() {
return meterId;
@@ -162,6 +171,7 @@ private boolean equalTo(BillingPriceView other) {
&& currency.equals(other.currency)
&& id.equals(other.id)
&& interval.equals(other.interval)
+ && isActive == other.isActive
&& meterId.equals(other.meterId)
&& price == other.price
&& priceExternalId.equals(other.priceExternalId)
@@ -180,6 +190,7 @@ public int hashCode() {
this.currency,
this.id,
this.interval,
+ this.isActive,
this.meterId,
this.price,
this.priceExternalId,
@@ -215,7 +226,11 @@ public interface IdStage {
}
public interface IntervalStage {
- PriceStage interval(@NotNull String interval);
+ IsActiveStage interval(@NotNull String interval);
+ }
+
+ public interface IsActiveStage {
+ PriceStage isActive(boolean isActive);
}
public interface PriceStage {
@@ -264,6 +279,7 @@ public static final class Builder
CurrencyStage,
IdStage,
IntervalStage,
+ IsActiveStage,
PriceStage,
PriceExternalIdStage,
PriceIdStage,
@@ -281,6 +297,8 @@ public static final class Builder
private String interval;
+ private boolean isActive;
+
private int price;
private String priceExternalId;
@@ -310,6 +328,7 @@ public Builder from(BillingPriceView other) {
currency(other.getCurrency());
id(other.getId());
interval(other.getInterval());
+ isActive(other.getIsActive());
meterId(other.getMeterId());
price(other.getPrice());
priceExternalId(other.getPriceExternalId());
@@ -345,11 +364,18 @@ public IntervalStage id(@NotNull String id) {
@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) {
@@ -426,6 +452,7 @@ public BillingPriceView build() {
currency,
id,
interval,
+ isActive,
meterId,
price,
priceExternalId,
diff --git a/src/main/java/com/schematic/api/types/BillingProductPriceResponseData.java b/src/main/java/com/schematic/api/types/BillingProductPriceResponseData.java
index 5429388..016d990 100644
--- a/src/main/java/com/schematic/api/types/BillingProductPriceResponseData.java
+++ b/src/main/java/com/schematic/api/types/BillingProductPriceResponseData.java
@@ -30,6 +30,8 @@ public final class BillingProductPriceResponseData {
private final String interval;
+ private final boolean isActive;
+
private final Optional meterId;
private final int price;
@@ -49,6 +51,7 @@ private BillingProductPriceResponseData(
String currency,
String id,
String interval,
+ boolean isActive,
Optional meterId,
int price,
String priceExternalId,
@@ -60,6 +63,7 @@ private BillingProductPriceResponseData(
this.currency = currency;
this.id = id;
this.interval = interval;
+ this.isActive = isActive;
this.meterId = meterId;
this.price = price;
this.priceExternalId = priceExternalId;
@@ -89,6 +93,11 @@ public String getInterval() {
return interval;
}
+ @JsonProperty("is_active")
+ public boolean getIsActive() {
+ return isActive;
+ }
+
@JsonProperty("meter_id")
public Optional getMeterId() {
return meterId;
@@ -135,6 +144,7 @@ private boolean equalTo(BillingProductPriceResponseData other) {
&& currency.equals(other.currency)
&& id.equals(other.id)
&& interval.equals(other.interval)
+ && isActive == other.isActive
&& meterId.equals(other.meterId)
&& price == other.price
&& priceExternalId.equals(other.priceExternalId)
@@ -150,6 +160,7 @@ public int hashCode() {
this.currency,
this.id,
this.interval,
+ this.isActive,
this.meterId,
this.price,
this.priceExternalId,
@@ -182,7 +193,11 @@ public interface IdStage {
}
public interface IntervalStage {
- PriceStage interval(@NotNull String interval);
+ IsActiveStage interval(@NotNull String interval);
+ }
+
+ public interface IsActiveStage {
+ PriceStage isActive(boolean isActive);
}
public interface PriceStage {
@@ -219,6 +234,7 @@ public static final class Builder
CurrencyStage,
IdStage,
IntervalStage,
+ IsActiveStage,
PriceStage,
PriceExternalIdStage,
ProductExternalIdStage,
@@ -233,6 +249,8 @@ public static final class Builder
private String interval;
+ private boolean isActive;
+
private int price;
private String priceExternalId;
@@ -256,6 +274,7 @@ public Builder from(BillingProductPriceResponseData other) {
currency(other.getCurrency());
id(other.getId());
interval(other.getInterval());
+ isActive(other.getIsActive());
meterId(other.getMeterId());
price(other.getPrice());
priceExternalId(other.getPriceExternalId());
@@ -288,11 +307,18 @@ public IntervalStage id(@NotNull String id) {
@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) {
@@ -348,6 +374,7 @@ public BillingProductPriceResponseData build() {
currency,
id,
interval,
+ isActive,
meterId,
price,
priceExternalId,
diff --git a/src/main/java/com/schematic/api/types/CheckFlagOutputWithFlagKey.java b/src/main/java/com/schematic/api/types/CheckFlagOutputWithFlagKey.java
deleted file mode 100644
index 0c21c35..0000000
--- a/src/main/java/com/schematic/api/types/CheckFlagOutputWithFlagKey.java
+++ /dev/null
@@ -1,306 +0,0 @@
-/**
- * This file was auto-generated by Fern from our API Definition.
- */
-package com.schematic.api.types;
-
-import com.fasterxml.jackson.annotation.JsonAnyGetter;
-import com.fasterxml.jackson.annotation.JsonAnySetter;
-import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonSetter;
-import com.fasterxml.jackson.annotation.Nulls;
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-import com.schematic.api.core.ObjectMappers;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Objects;
-import java.util.Optional;
-import org.jetbrains.annotations.NotNull;
-
-@JsonInclude(JsonInclude.Include.NON_ABSENT)
-@JsonDeserialize(builder = CheckFlagOutputWithFlagKey.Builder.class)
-public final class CheckFlagOutputWithFlagKey {
- private final Optional companyId;
-
- private final Optional error;
-
- private final String flag;
-
- private final Optional flagId;
-
- private final String reason;
-
- private final Optional ruleId;
-
- private final Optional userId;
-
- private final boolean value;
-
- private final Map additionalProperties;
-
- private CheckFlagOutputWithFlagKey(
- Optional companyId,
- Optional error,
- String flag,
- Optional flagId,
- String reason,
- Optional ruleId,
- Optional userId,
- boolean value,
- Map additionalProperties) {
- this.companyId = companyId;
- this.error = error;
- this.flag = flag;
- this.flagId = flagId;
- this.reason = reason;
- this.ruleId = ruleId;
- this.userId = userId;
- this.value = value;
- this.additionalProperties = additionalProperties;
- }
-
- @JsonProperty("company_id")
- public Optional getCompanyId() {
- return companyId;
- }
-
- @JsonProperty("error")
- public Optional getError() {
- return error;
- }
-
- @JsonProperty("flag")
- public String getFlag() {
- return flag;
- }
-
- @JsonProperty("flag_id")
- public Optional getFlagId() {
- return flagId;
- }
-
- @JsonProperty("reason")
- public String getReason() {
- return reason;
- }
-
- @JsonProperty("rule_id")
- public Optional getRuleId() {
- return ruleId;
- }
-
- @JsonProperty("user_id")
- public Optional getUserId() {
- return userId;
- }
-
- @JsonProperty("value")
- public boolean getValue() {
- return value;
- }
-
- @java.lang.Override
- public boolean equals(Object other) {
- if (this == other) return true;
- return other instanceof CheckFlagOutputWithFlagKey && equalTo((CheckFlagOutputWithFlagKey) other);
- }
-
- @JsonAnyGetter
- public Map getAdditionalProperties() {
- return this.additionalProperties;
- }
-
- private boolean equalTo(CheckFlagOutputWithFlagKey other) {
- return companyId.equals(other.companyId)
- && error.equals(other.error)
- && flag.equals(other.flag)
- && flagId.equals(other.flagId)
- && reason.equals(other.reason)
- && ruleId.equals(other.ruleId)
- && userId.equals(other.userId)
- && value == other.value;
- }
-
- @java.lang.Override
- public int hashCode() {
- return Objects.hash(
- this.companyId, this.error, this.flag, this.flagId, this.reason, this.ruleId, this.userId, this.value);
- }
-
- @java.lang.Override
- public String toString() {
- return ObjectMappers.stringify(this);
- }
-
- public static FlagStage builder() {
- return new Builder();
- }
-
- public interface FlagStage {
- ReasonStage flag(@NotNull String flag);
-
- Builder from(CheckFlagOutputWithFlagKey other);
- }
-
- public interface ReasonStage {
- ValueStage reason(@NotNull String reason);
- }
-
- public interface ValueStage {
- _FinalStage value(boolean value);
- }
-
- public interface _FinalStage {
- CheckFlagOutputWithFlagKey build();
-
- _FinalStage companyId(Optional companyId);
-
- _FinalStage companyId(String companyId);
-
- _FinalStage error(Optional error);
-
- _FinalStage error(String error);
-
- _FinalStage flagId(Optional flagId);
-
- _FinalStage flagId(String flagId);
-
- _FinalStage ruleId(Optional ruleId);
-
- _FinalStage ruleId(String ruleId);
-
- _FinalStage userId(Optional userId);
-
- _FinalStage userId(String userId);
- }
-
- @JsonIgnoreProperties(ignoreUnknown = true)
- public static final class Builder implements FlagStage, ReasonStage, ValueStage, _FinalStage {
- private String flag;
-
- private String reason;
-
- private boolean value;
-
- private Optional userId = Optional.empty();
-
- private Optional ruleId = Optional.empty();
-
- private Optional flagId = Optional.empty();
-
- private Optional error = Optional.empty();
-
- private Optional companyId = Optional.empty();
-
- @JsonAnySetter
- private Map additionalProperties = new HashMap<>();
-
- private Builder() {}
-
- @java.lang.Override
- public Builder from(CheckFlagOutputWithFlagKey other) {
- companyId(other.getCompanyId());
- error(other.getError());
- flag(other.getFlag());
- flagId(other.getFlagId());
- reason(other.getReason());
- ruleId(other.getRuleId());
- userId(other.getUserId());
- value(other.getValue());
- return this;
- }
-
- @java.lang.Override
- @JsonSetter("flag")
- public ReasonStage flag(@NotNull String flag) {
- this.flag = Objects.requireNonNull(flag, "flag must not be null");
- return this;
- }
-
- @java.lang.Override
- @JsonSetter("reason")
- public ValueStage reason(@NotNull String reason) {
- this.reason = Objects.requireNonNull(reason, "reason must not be null");
- return this;
- }
-
- @java.lang.Override
- @JsonSetter("value")
- public _FinalStage value(boolean value) {
- this.value = value;
- return this;
- }
-
- @java.lang.Override
- public _FinalStage userId(String userId) {
- this.userId = Optional.ofNullable(userId);
- return this;
- }
-
- @java.lang.Override
- @JsonSetter(value = "user_id", nulls = Nulls.SKIP)
- public _FinalStage userId(Optional userId) {
- this.userId = userId;
- return this;
- }
-
- @java.lang.Override
- public _FinalStage ruleId(String ruleId) {
- this.ruleId = Optional.ofNullable(ruleId);
- return this;
- }
-
- @java.lang.Override
- @JsonSetter(value = "rule_id", nulls = Nulls.SKIP)
- public _FinalStage ruleId(Optional ruleId) {
- this.ruleId = ruleId;
- return this;
- }
-
- @java.lang.Override
- public _FinalStage flagId(String flagId) {
- this.flagId = Optional.ofNullable(flagId);
- return this;
- }
-
- @java.lang.Override
- @JsonSetter(value = "flag_id", nulls = Nulls.SKIP)
- public _FinalStage flagId(Optional flagId) {
- this.flagId = flagId;
- return this;
- }
-
- @java.lang.Override
- public _FinalStage error(String error) {
- this.error = Optional.ofNullable(error);
- return this;
- }
-
- @java.lang.Override
- @JsonSetter(value = "error", nulls = Nulls.SKIP)
- public _FinalStage error(Optional error) {
- this.error = error;
- return this;
- }
-
- @java.lang.Override
- public _FinalStage companyId(String companyId) {
- this.companyId = Optional.ofNullable(companyId);
- return this;
- }
-
- @java.lang.Override
- @JsonSetter(value = "company_id", nulls = Nulls.SKIP)
- public _FinalStage companyId(Optional companyId) {
- this.companyId = companyId;
- return this;
- }
-
- @java.lang.Override
- public CheckFlagOutputWithFlagKey build() {
- return new CheckFlagOutputWithFlagKey(
- companyId, error, flag, flagId, reason, ruleId, userId, value, additionalProperties);
- }
- }
-}
diff --git a/src/main/java/com/schematic/api/types/CheckFlagResponseData.java b/src/main/java/com/schematic/api/types/CheckFlagResponseData.java
index a8bbd4d..59f6f4e 100644
--- a/src/main/java/com/schematic/api/types/CheckFlagResponseData.java
+++ b/src/main/java/com/schematic/api/types/CheckFlagResponseData.java
@@ -12,6 +12,7 @@
import com.fasterxml.jackson.annotation.Nulls;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.schematic.api.core.ObjectMappers;
+import java.time.OffsetDateTime;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
@@ -25,12 +26,24 @@ public final class CheckFlagResponseData {
private final Optional error;
+ private final Optional featureAllocation;
+
+ private final Optional featureUsage;
+
+ private final Optional featureUsagePeriod;
+
+ private final Optional featureUsageResetAt;
+
+ private final String flag;
+
private final Optional flagId;
private final String reason;
private final Optional ruleId;
+ private final Optional ruleType;
+
private final Optional userId;
private final boolean value;
@@ -40,52 +53,133 @@ public final class CheckFlagResponseData {
private CheckFlagResponseData(
Optional companyId,
Optional error,
+ Optional featureAllocation,
+ Optional featureUsage,
+ Optional featureUsagePeriod,
+ Optional featureUsageResetAt,
+ String flag,
Optional flagId,
String reason,
Optional ruleId,
+ Optional ruleType,
Optional userId,
boolean value,
Map additionalProperties) {
this.companyId = companyId;
this.error = error;
+ this.featureAllocation = featureAllocation;
+ this.featureUsage = featureUsage;
+ this.featureUsagePeriod = featureUsagePeriod;
+ this.featureUsageResetAt = featureUsageResetAt;
+ this.flag = flag;
this.flagId = flagId;
this.reason = reason;
this.ruleId = ruleId;
+ this.ruleType = ruleType;
this.userId = userId;
this.value = value;
this.additionalProperties = additionalProperties;
}
+ /**
+ * @return If company keys were provided and matched a company, its ID
+ */
@JsonProperty("company_id")
public Optional getCompanyId() {
return companyId;
}
+ /**
+ * @return If an error occurred while checking the flag, the error message
+ */
@JsonProperty("error")
public Optional getError() {
return error;
}
+ /**
+ * @return If a numeric feature entitlement rule was matched, its allocation
+ */
+ @JsonProperty("feature_allocation")
+ public Optional getFeatureAllocation() {
+ return featureAllocation;
+ }
+
+ /**
+ * @return If a numeric feature entitlement rule was matched, the company's usage
+ */
+ @JsonProperty("feature_usage")
+ public Optional getFeatureUsage() {
+ return featureUsage;
+ }
+
+ /**
+ * @return For event-based feature entitlement rules, the period over which usage is tracked (current_month, current_day, current_week, all_time)
+ */
+ @JsonProperty("feature_usage_period")
+ public Optional getFeatureUsagePeriod() {
+ return featureUsagePeriod;
+ }
+
+ /**
+ * @return For event-based feature entitlement rules, when the usage period will reset
+ */
+ @JsonProperty("feature_usage_reset_at")
+ public Optional getFeatureUsageResetAt() {
+ return featureUsageResetAt;
+ }
+
+ /**
+ * @return The key used to check the flag
+ */
+ @JsonProperty("flag")
+ public String getFlag() {
+ return flag;
+ }
+
+ /**
+ * @return If a flag was found, its ID
+ */
@JsonProperty("flag_id")
public Optional getFlagId() {
return flagId;
}
+ /**
+ * @return A human-readable explanation of the result
+ */
@JsonProperty("reason")
public String getReason() {
return reason;
}
+ /**
+ * @return If a rule was found, its ID
+ */
@JsonProperty("rule_id")
public Optional getRuleId() {
return ruleId;
}
+ /**
+ * @return If a rule was found, its type
+ */
+ @JsonProperty("rule_type")
+ public Optional getRuleType() {
+ return ruleType;
+ }
+
+ /**
+ * @return If user keys were provided and matched a user, its ID
+ */
@JsonProperty("user_id")
public Optional getUserId() {
return userId;
}
+ /**
+ * @return A boolean flag check result; for feature entitlements, this represents whether further consumption of the feature is permitted
+ */
@JsonProperty("value")
public boolean getValue() {
return value;
@@ -105,16 +199,35 @@ public Map getAdditionalProperties() {
private boolean equalTo(CheckFlagResponseData other) {
return companyId.equals(other.companyId)
&& error.equals(other.error)
+ && featureAllocation.equals(other.featureAllocation)
+ && featureUsage.equals(other.featureUsage)
+ && featureUsagePeriod.equals(other.featureUsagePeriod)
+ && featureUsageResetAt.equals(other.featureUsageResetAt)
+ && flag.equals(other.flag)
&& flagId.equals(other.flagId)
&& reason.equals(other.reason)
&& ruleId.equals(other.ruleId)
+ && ruleType.equals(other.ruleType)
&& userId.equals(other.userId)
&& value == other.value;
}
@java.lang.Override
public int hashCode() {
- return Objects.hash(this.companyId, this.error, this.flagId, this.reason, this.ruleId, this.userId, this.value);
+ return Objects.hash(
+ this.companyId,
+ this.error,
+ this.featureAllocation,
+ this.featureUsage,
+ this.featureUsagePeriod,
+ this.featureUsageResetAt,
+ this.flag,
+ this.flagId,
+ this.reason,
+ this.ruleId,
+ this.ruleType,
+ this.userId,
+ this.value);
}
@java.lang.Override
@@ -122,16 +235,20 @@ public String toString() {
return ObjectMappers.stringify(this);
}
- public static ReasonStage builder() {
+ public static FlagStage builder() {
return new Builder();
}
- public interface ReasonStage {
- ValueStage reason(@NotNull String reason);
+ public interface FlagStage {
+ ReasonStage flag(@NotNull String flag);
Builder from(CheckFlagResponseData other);
}
+ public interface ReasonStage {
+ ValueStage reason(@NotNull String reason);
+ }
+
public interface ValueStage {
_FinalStage value(boolean value);
}
@@ -147,6 +264,22 @@ public interface _FinalStage {
_FinalStage error(String error);
+ _FinalStage featureAllocation(Optional featureAllocation);
+
+ _FinalStage featureAllocation(Integer featureAllocation);
+
+ _FinalStage featureUsage(Optional featureUsage);
+
+ _FinalStage featureUsage(Integer featureUsage);
+
+ _FinalStage featureUsagePeriod(Optional featureUsagePeriod);
+
+ _FinalStage featureUsagePeriod(String featureUsagePeriod);
+
+ _FinalStage featureUsageResetAt(Optional featureUsageResetAt);
+
+ _FinalStage featureUsageResetAt(OffsetDateTime featureUsageResetAt);
+
_FinalStage flagId(Optional flagId);
_FinalStage flagId(String flagId);
@@ -155,23 +288,39 @@ public interface _FinalStage {
_FinalStage ruleId(String ruleId);
+ _FinalStage ruleType(Optional ruleType);
+
+ _FinalStage ruleType(String ruleType);
+
_FinalStage userId(Optional userId);
_FinalStage userId(String userId);
}
@JsonIgnoreProperties(ignoreUnknown = true)
- public static final class Builder implements ReasonStage, ValueStage, _FinalStage {
+ public static final class Builder implements FlagStage, ReasonStage, ValueStage, _FinalStage {
+ private String flag;
+
private String reason;
private boolean value;
private Optional userId = Optional.empty();
+ private Optional ruleType = Optional.empty();
+
private Optional ruleId = Optional.empty();
private Optional flagId = Optional.empty();
+ private Optional featureUsageResetAt = Optional.empty();
+
+ private Optional featureUsagePeriod = Optional.empty();
+
+ private Optional featureUsage = Optional.empty();
+
+ private Optional featureAllocation = Optional.empty();
+
private Optional error = Optional.empty();
private Optional companyId = Optional.empty();
@@ -185,14 +334,35 @@ private Builder() {}
public Builder from(CheckFlagResponseData other) {
companyId(other.getCompanyId());
error(other.getError());
+ featureAllocation(other.getFeatureAllocation());
+ featureUsage(other.getFeatureUsage());
+ featureUsagePeriod(other.getFeatureUsagePeriod());
+ featureUsageResetAt(other.getFeatureUsageResetAt());
+ flag(other.getFlag());
flagId(other.getFlagId());
reason(other.getReason());
ruleId(other.getRuleId());
+ ruleType(other.getRuleType());
userId(other.getUserId());
value(other.getValue());
return this;
}
+ /**
+ * The key used to check the flag
+ * @return Reference to {@code this} so that method calls can be chained together.
+ */
+ @java.lang.Override
+ @JsonSetter("flag")
+ public ReasonStage flag(@NotNull String flag) {
+ this.flag = Objects.requireNonNull(flag, "flag must not be null");
+ return this;
+ }
+
+ /**
+ * A human-readable explanation of the result
+ * @return Reference to {@code this} so that method calls can be chained together.
+ */
@java.lang.Override
@JsonSetter("reason")
public ValueStage reason(@NotNull String reason) {
@@ -200,6 +370,10 @@ public ValueStage reason(@NotNull String reason) {
return this;
}
+ /**
+ * A boolean flag check result; for feature entitlements, this represents whether further consumption of the feature is permitted
+ * @return Reference to {@code this} so that method calls can be chained together.
+ */
@java.lang.Override
@JsonSetter("value")
public _FinalStage value(boolean value) {
@@ -207,6 +381,10 @@ public _FinalStage value(boolean value) {
return this;
}
+ /**
+ * If user keys were provided and matched a user, its ID
+ * @return Reference to {@code this} so that method calls can be chained together.
+ */
@java.lang.Override
public _FinalStage userId(String userId) {
this.userId = Optional.ofNullable(userId);
@@ -220,6 +398,27 @@ public _FinalStage userId(Optional userId) {
return this;
}
+ /**
+ * If a rule was found, its type
+ * @return Reference to {@code this} so that method calls can be chained together.
+ */
+ @java.lang.Override
+ public _FinalStage ruleType(String ruleType) {
+ this.ruleType = Optional.ofNullable(ruleType);
+ return this;
+ }
+
+ @java.lang.Override
+ @JsonSetter(value = "rule_type", nulls = Nulls.SKIP)
+ public _FinalStage ruleType(Optional ruleType) {
+ this.ruleType = ruleType;
+ return this;
+ }
+
+ /**
+ * If a rule was found, its ID
+ * @return Reference to {@code this} so that method calls can be chained together.
+ */
@java.lang.Override
public _FinalStage ruleId(String ruleId) {
this.ruleId = Optional.ofNullable(ruleId);
@@ -233,6 +432,10 @@ public _FinalStage ruleId(Optional ruleId) {
return this;
}
+ /**
+ * If a flag was found, its ID
+ * @return Reference to {@code this} so that method calls can be chained together.
+ */
@java.lang.Override
public _FinalStage flagId(String flagId) {
this.flagId = Optional.ofNullable(flagId);
@@ -246,6 +449,78 @@ public _FinalStage flagId(Optional flagId) {
return this;
}
+ /**
+ * For event-based feature entitlement rules, when the usage period will reset
+ * @return Reference to {@code this} so that method calls can be chained together.
+ */
+ @java.lang.Override
+ public _FinalStage featureUsageResetAt(OffsetDateTime featureUsageResetAt) {
+ this.featureUsageResetAt = Optional.ofNullable(featureUsageResetAt);
+ return this;
+ }
+
+ @java.lang.Override
+ @JsonSetter(value = "feature_usage_reset_at", nulls = Nulls.SKIP)
+ public _FinalStage featureUsageResetAt(Optional featureUsageResetAt) {
+ this.featureUsageResetAt = featureUsageResetAt;
+ return this;
+ }
+
+ /**
+ * For event-based feature entitlement rules, the period over which usage is tracked (current_month, current_day, current_week, all_time)
+ * @return Reference to {@code this} so that method calls can be chained together.
+ */
+ @java.lang.Override
+ public _FinalStage featureUsagePeriod(String featureUsagePeriod) {
+ this.featureUsagePeriod = Optional.ofNullable(featureUsagePeriod);
+ return this;
+ }
+
+ @java.lang.Override
+ @JsonSetter(value = "feature_usage_period", nulls = Nulls.SKIP)
+ public _FinalStage featureUsagePeriod(Optional featureUsagePeriod) {
+ this.featureUsagePeriod = featureUsagePeriod;
+ return this;
+ }
+
+ /**
+ * If a numeric feature entitlement rule was matched, the company's usage
+ * @return Reference to {@code this} so that method calls can be chained together.
+ */
+ @java.lang.Override
+ public _FinalStage featureUsage(Integer featureUsage) {
+ this.featureUsage = Optional.ofNullable(featureUsage);
+ return this;
+ }
+
+ @java.lang.Override
+ @JsonSetter(value = "feature_usage", nulls = Nulls.SKIP)
+ public _FinalStage featureUsage(Optional featureUsage) {
+ this.featureUsage = featureUsage;
+ return this;
+ }
+
+ /**
+ * If a numeric feature entitlement rule was matched, its allocation
+ * @return Reference to {@code this} so that method calls can be chained together.
+ */
+ @java.lang.Override
+ public _FinalStage featureAllocation(Integer featureAllocation) {
+ this.featureAllocation = Optional.ofNullable(featureAllocation);
+ return this;
+ }
+
+ @java.lang.Override
+ @JsonSetter(value = "feature_allocation", nulls = Nulls.SKIP)
+ public _FinalStage featureAllocation(Optional featureAllocation) {
+ this.featureAllocation = featureAllocation;
+ return this;
+ }
+
+ /**
+ * If an error occurred while checking the flag, the error message
+ * @return Reference to {@code this} so that method calls can be chained together.
+ */
@java.lang.Override
public _FinalStage error(String error) {
this.error = Optional.ofNullable(error);
@@ -259,6 +534,10 @@ public _FinalStage error(Optional error) {
return this;
}
+ /**
+ * If company keys were provided and matched a company, its ID
+ * @return Reference to {@code this} so that method calls can be chained together.
+ */
@java.lang.Override
public _FinalStage companyId(String companyId) {
this.companyId = Optional.ofNullable(companyId);
@@ -275,7 +554,20 @@ public _FinalStage companyId(Optional companyId) {
@java.lang.Override
public CheckFlagResponseData build() {
return new CheckFlagResponseData(
- companyId, error, flagId, reason, ruleId, userId, value, additionalProperties);
+ companyId,
+ error,
+ featureAllocation,
+ featureUsage,
+ featureUsagePeriod,
+ featureUsageResetAt,
+ flag,
+ flagId,
+ reason,
+ ruleId,
+ ruleType,
+ userId,
+ value,
+ additionalProperties);
}
}
}
diff --git a/src/main/java/com/schematic/api/types/CheckFlagsResponseData.java b/src/main/java/com/schematic/api/types/CheckFlagsResponseData.java
index 822daf5..0375f8f 100644
--- a/src/main/java/com/schematic/api/types/CheckFlagsResponseData.java
+++ b/src/main/java/com/schematic/api/types/CheckFlagsResponseData.java
@@ -21,17 +21,17 @@
@JsonInclude(JsonInclude.Include.NON_ABSENT)
@JsonDeserialize(builder = CheckFlagsResponseData.Builder.class)
public final class CheckFlagsResponseData {
- private final List flags;
+ private final List flags;
private final Map additionalProperties;
- private CheckFlagsResponseData(List flags, Map additionalProperties) {
+ private CheckFlagsResponseData(List flags, Map additionalProperties) {
this.flags = flags;
this.additionalProperties = additionalProperties;
}
@JsonProperty("flags")
- public List getFlags() {
+ public List getFlags() {
return flags;
}
@@ -66,7 +66,7 @@ public static Builder builder() {
@JsonIgnoreProperties(ignoreUnknown = true)
public static final class Builder {
- private List flags = new ArrayList<>();
+ private List flags = new ArrayList<>();
@JsonAnySetter
private Map additionalProperties = new HashMap<>();
@@ -79,18 +79,18 @@ public Builder from(CheckFlagsResponseData other) {
}
@JsonSetter(value = "flags", nulls = Nulls.SKIP)
- public Builder flags(List flags) {
+ public Builder flags(List flags) {
this.flags.clear();
this.flags.addAll(flags);
return this;
}
- public Builder addFlags(CheckFlagOutputWithFlagKey flags) {
+ public Builder addFlags(CheckFlagResponseData flags) {
this.flags.add(flags);
return this;
}
- public Builder addAllFlags(List flags) {
+ public Builder addAllFlags(List flags) {
this.flags.addAll(flags);
return this;
}
diff --git a/src/main/java/com/schematic/api/types/CheckoutDataResponseData.java b/src/main/java/com/schematic/api/types/CheckoutDataResponseData.java
new file mode 100644
index 0000000..0785869
--- /dev/null
+++ b/src/main/java/com/schematic/api/types/CheckoutDataResponseData.java
@@ -0,0 +1,246 @@
+/**
+ * This file was auto-generated by Fern from our API Definition.
+ */
+package com.schematic.api.types;
+
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonSetter;
+import com.fasterxml.jackson.annotation.Nulls;
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import com.schematic.api.core.ObjectMappers;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Optional;
+
+@JsonInclude(JsonInclude.Include.NON_ABSENT)
+@JsonDeserialize(builder = CheckoutDataResponseData.Builder.class)
+public final class CheckoutDataResponseData {
+ private final List activeAddOns;
+
+ private final Optional activePlan;
+
+ private final List activeUsageBasedEntitlements;
+
+ private final Optional company;
+
+ private final Optional featureUsage;
+
+ private final Optional subscription;
+
+ private final Map additionalProperties;
+
+ private CheckoutDataResponseData(
+ List activeAddOns,
+ Optional activePlan,
+ List activeUsageBasedEntitlements,
+ Optional company,
+ Optional featureUsage,
+ Optional subscription,
+ Map additionalProperties) {
+ this.activeAddOns = activeAddOns;
+ this.activePlan = activePlan;
+ this.activeUsageBasedEntitlements = activeUsageBasedEntitlements;
+ this.company = company;
+ this.featureUsage = featureUsage;
+ this.subscription = subscription;
+ this.additionalProperties = additionalProperties;
+ }
+
+ @JsonProperty("active_add_ons")
+ public List getActiveAddOns() {
+ return activeAddOns;
+ }
+
+ @JsonProperty("active_plan")
+ public Optional getActivePlan() {
+ return activePlan;
+ }
+
+ @JsonProperty("active_usage_based_entitlements")
+ public List getActiveUsageBasedEntitlements() {
+ return activeUsageBasedEntitlements;
+ }
+
+ @JsonProperty("company")
+ public Optional getCompany() {
+ return company;
+ }
+
+ @JsonProperty("feature_usage")
+ public Optional getFeatureUsage() {
+ return featureUsage;
+ }
+
+ @JsonProperty("subscription")
+ public Optional