diff --git a/.fern/metadata.json b/.fern/metadata.json
index 5ee5cee..b61fbff 100644
--- a/.fern/metadata.json
+++ b/.fern/metadata.json
@@ -14,10 +14,10 @@
"implementation redis.clients:jedis:5.2.0"
]
},
- "originGitCommit": "340529eacf4f1dcc5522e771872c1dd94b9c4891",
+ "originGitCommit": "a9fc73b97dcfa602bff97a7d41d980a55c9c9030",
"originGitCommitIsDirty": false,
"invokedBy": "ci",
- "requestedVersion": "1.5.3",
+ "requestedVersion": "1.5.4",
"ciProvider": "github",
- "sdkVersion": "1.5.3"
+ "sdkVersion": "1.5.4"
}
\ No newline at end of file
diff --git a/.fern/replay.lock b/.fern/replay.lock
index b9fd14a..e55ba63 100644
--- a/.fern/replay.lock
+++ b/.fern/replay.lock
@@ -24,5 +24,11 @@ generations:
cli_version: unknown
generator_versions:
fernapi/fern-java-sdk: 4.11.1
-current_generation: 89360cf8750d3589d707ec7f8402d9858ed819eb
+ - commit_sha: 7fc1ea4af8ebf683e8739f2b1fb365bd61e60e98
+ tree_hash: 055fadadeb0be970e2d592bfeeb26bd605242d2f
+ timestamp: 2026-08-03T11:06:30.344Z
+ cli_version: unknown
+ generator_versions:
+ fernapi/fern-java-sdk: 4.11.1
+current_generation: 7fc1ea4af8ebf683e8739f2b1fb365bd61e60e98
patches: []
diff --git a/build.gradle b/build.gradle
index a292004..27c828f 100644
--- a/build.gradle
+++ b/build.gradle
@@ -62,7 +62,7 @@ java {
group = 'com.schematichq'
-version = '1.5.3'
+version = '1.5.4'
jar {
dependsOn(":generatePomFileForMavenPublication")
@@ -93,7 +93,7 @@ publishing {
maven(MavenPublication) {
groupId = 'com.schematichq'
artifactId = 'schematic-java'
- version = '1.5.3'
+ version = '1.5.4'
from components.java
pom {
name = 'Schematic'
diff --git a/reference.md b/reference.md
index d28f526..ce1f593 100644
--- a/reference.md
+++ b/reference.md
@@ -360,6 +360,14 @@ client.accounts().createApiKey(
-
+**rateLimitPercent:** `Optional`
+
+
+
+
+
+-
+
**readonly:** `Optional`
@@ -463,6 +471,14 @@ client.accounts().updateApiKey(
**name:** `Optional`
+
+
+
+
+-
+
+**rateLimitPercent:** `Optional`
+
@@ -2386,6 +2402,7 @@ client.billing().listBillingPrices(
.forInitialPlan(true)
.forTrialExpiryPlan(true)
.interval("interval")
+ .intervalCount(1000000L)
.isActive(true)
.planVersionId("plan_version_id")
.price(1000000L)
@@ -2453,6 +2470,14 @@ client.billing().listBillingPrices(
-
+**intervalCount:** `Optional` — Filter for prices billed every N intervals; combine with interval (e.g. interval=month, interval_count=3 for quarterly)
+
+
+
+
+
+-
+
**isActive:** `Optional` — Filter for active prices on active products (defaults to true if not specified)
@@ -2808,6 +2833,7 @@ client.billing().listBillingProductPrices(
.forInitialPlan(true)
.forTrialExpiryPlan(true)
.interval("interval")
+ .intervalCount(1000000L)
.isActive(true)
.planVersionId("plan_version_id")
.price(1000000L)
@@ -2875,6 +2901,14 @@ client.billing().listBillingProductPrices(
-
+**intervalCount:** `Optional` — Filter for prices billed every N intervals; combine with interval (e.g. interval=month, interval_count=3 for quarterly)
+
+
+
+
+
+-
+
**isActive:** `Optional` — Filter for active prices on active products (defaults to true if not specified)
@@ -6133,7 +6167,6 @@ client.catalogs().listCatalogs(
client.catalogs().createCatalog(
CreateCatalogRequestBody
.builder()
- .isDefault(true)
.name("name")
.build()
);
@@ -6159,14 +6192,6 @@ client.catalogs().createCatalog(
-
-**isDefault:** `Boolean`
-
-
-
-
-
--
-
**name:** `String`
@@ -7157,6 +7182,14 @@ client.checkout().updateCompanyBillingDetails(
-
+**taxId:** `Optional`
+
+
+
+
+
+-
+
**values:** `List`
@@ -12760,6 +12793,150 @@ client.entitlements().getFeatureUsageByCompany(
+
+
+
+
+client.entitlements.getUserUsageByCompany() -> GetUserUsageByCompanyResponse
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```java
+client.entitlements().getUserUsageByCompany(
+ GetUserUsageByCompanyRequest
+ .builder()
+ .companyId("company_id")
+ .endTime(OffsetDateTime.parse("2024-01-15T09:30:00Z"))
+ .featureId("feature_id")
+ .startTime(OffsetDateTime.parse("2024-01-15T09:30:00Z"))
+ .build()
+);
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**companyId:** `String` — Company to break usage down for
+
+
+
+
+
+-
+
+**endTime:** `Optional` — End of the usage window (exclusive); defaults to now
+
+
+
+
+
+-
+
+**featureId:** `Optional` — Restrict to a single event-based feature
+
+
+
+
+
+-
+
+**startTime:** `Optional` — Start of the usage window; defaults to 30 days before the end
+
+
+
+
+
+
+
+
+
+
+
+client.entitlements.getUserUsageDetail() -> GetUserUsageDetailResponse
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```java
+client.entitlements().getUserUsageDetail(
+ GetUserUsageDetailRequest
+ .builder()
+ .companyId("company_id")
+ .userId("user_id")
+ .endTime(OffsetDateTime.parse("2024-01-15T09:30:00Z"))
+ .startTime(OffsetDateTime.parse("2024-01-15T09:30:00Z"))
+ .build()
+);
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**companyId:** `String` — Company the user belongs to
+
+
+
+
+
+-
+
+**endTime:** `Optional` — End of the usage window (exclusive); defaults to now
+
+
+
+
+
+-
+
+**startTime:** `Optional` — Start of the usage window; defaults to 30 days before the end
+
+
+
+
+
+-
+
+**userId:** `String` — User to break usage down for
+
+
+
+
+
+
+
@@ -13034,6 +13211,14 @@ client.plans().retryCustomPlanBilling(
**daysUntilDue:** `Optional`
+
+
+
+
+-
+
+**sendInvoice:** `Optional` — Whether Stripe emails the invoice when it is finalized. Defaults to true.
+
@@ -14157,6 +14342,14 @@ client.plans().publishPlanVersion(
-
+**address:** `Optional`
+
+
+
+
+
+-
+
**couponExternalId:** `Optional`
@@ -14165,6 +14358,14 @@ client.plans().publishPlanVersion(
-
+**customFieldValues:** `Optional
>`
+
+
+
+
+
+-
+
**customerEmail:** `Optional`
@@ -14191,6 +14392,30 @@ client.plans().publishPlanVersion(
**migrationStrategy:** `PlanVersionMigrationStrategy`
+
+
+
+
+-
+
+**phone:** `Optional`
+
+
+
+
+
+-
+
+**sendInvoice:** `Optional` — Whether Stripe emails the invoice when it is finalized. Defaults to true.
+
+
+
+
+
+-
+
+**taxId:** `Optional`
+
diff --git a/src/main/java/com/schematic/api/core/ClientOptions.java b/src/main/java/com/schematic/api/core/ClientOptions.java
index d3dc508..514e4b2 100644
--- a/src/main/java/com/schematic/api/core/ClientOptions.java
+++ b/src/main/java/com/schematic/api/core/ClientOptions.java
@@ -38,10 +38,10 @@ private ClientOptions(
this.headers.putAll(headers);
this.headers.putAll(new HashMap() {
{
- put("User-Agent", "com.schematichq:schematic-java/1.5.3");
+ put("User-Agent", "com.schematichq:schematic-java/1.5.4");
put("X-Fern-Language", "JAVA");
put("X-Fern-SDK-Name", "com.schematic.fern:api-sdk");
- put("X-Fern-SDK-Version", "1.5.3");
+ put("X-Fern-SDK-Version", "1.5.4");
}
});
this.headerSuppliers = headerSuppliers;
diff --git a/src/main/java/com/schematic/api/resources/accounts/requests/CreateApiKeyRequestBody.java b/src/main/java/com/schematic/api/resources/accounts/requests/CreateApiKeyRequestBody.java
index b05963c..11d4a09 100644
--- a/src/main/java/com/schematic/api/resources/accounts/requests/CreateApiKeyRequestBody.java
+++ b/src/main/java/com/schematic/api/resources/accounts/requests/CreateApiKeyRequestBody.java
@@ -27,6 +27,8 @@ public final class CreateApiKeyRequestBody {
private final String name;
+ private final Optional rateLimitPercent;
+
private final Optional readonly;
private final Map additionalProperties;
@@ -35,11 +37,13 @@ private CreateApiKeyRequestBody(
Optional description,
Optional environmentId,
String name,
+ Optional rateLimitPercent,
Optional readonly,
Map additionalProperties) {
this.description = description;
this.environmentId = environmentId;
this.name = name;
+ this.rateLimitPercent = rateLimitPercent;
this.readonly = readonly;
this.additionalProperties = additionalProperties;
}
@@ -59,6 +63,11 @@ public String getName() {
return name;
}
+ @JsonProperty("rate_limit_percent")
+ public Optional getRateLimitPercent() {
+ return rateLimitPercent;
+ }
+
@JsonProperty("readonly")
public Optional getReadonly() {
return readonly;
@@ -79,12 +88,13 @@ private boolean equalTo(CreateApiKeyRequestBody other) {
return description.equals(other.description)
&& environmentId.equals(other.environmentId)
&& name.equals(other.name)
+ && rateLimitPercent.equals(other.rateLimitPercent)
&& readonly.equals(other.readonly);
}
@java.lang.Override
public int hashCode() {
- return Objects.hash(this.description, this.environmentId, this.name, this.readonly);
+ return Objects.hash(this.description, this.environmentId, this.name, this.rateLimitPercent, this.readonly);
}
@java.lang.Override
@@ -117,6 +127,10 @@ public interface _FinalStage {
_FinalStage environmentId(String environmentId);
+ _FinalStage rateLimitPercent(Optional rateLimitPercent);
+
+ _FinalStage rateLimitPercent(Long rateLimitPercent);
+
_FinalStage readonly(Optional readonly);
_FinalStage readonly(Boolean readonly);
@@ -128,6 +142,8 @@ public static final class Builder implements NameStage, _FinalStage {
private Optional readonly = Optional.empty();
+ private Optional rateLimitPercent = Optional.empty();
+
private Optional environmentId = Optional.empty();
private Optional description = Optional.empty();
@@ -142,6 +158,7 @@ public Builder from(CreateApiKeyRequestBody other) {
description(other.getDescription());
environmentId(other.getEnvironmentId());
name(other.getName());
+ rateLimitPercent(other.getRateLimitPercent());
readonly(other.getReadonly());
return this;
}
@@ -166,6 +183,19 @@ public _FinalStage readonly(Optional readonly) {
return this;
}
+ @java.lang.Override
+ public _FinalStage rateLimitPercent(Long rateLimitPercent) {
+ this.rateLimitPercent = Optional.ofNullable(rateLimitPercent);
+ return this;
+ }
+
+ @java.lang.Override
+ @JsonSetter(value = "rate_limit_percent", nulls = Nulls.SKIP)
+ public _FinalStage rateLimitPercent(Optional rateLimitPercent) {
+ this.rateLimitPercent = rateLimitPercent;
+ return this;
+ }
+
@java.lang.Override
public _FinalStage environmentId(String environmentId) {
this.environmentId = Optional.ofNullable(environmentId);
@@ -194,7 +224,8 @@ public _FinalStage description(Optional description) {
@java.lang.Override
public CreateApiKeyRequestBody build() {
- return new CreateApiKeyRequestBody(description, environmentId, name, readonly, additionalProperties);
+ return new CreateApiKeyRequestBody(
+ description, environmentId, name, rateLimitPercent, readonly, additionalProperties);
}
@java.lang.Override
diff --git a/src/main/java/com/schematic/api/resources/accounts/requests/UpdateApiKeyRequestBody.java b/src/main/java/com/schematic/api/resources/accounts/requests/UpdateApiKeyRequestBody.java
index 4da4e9d..1c53d92 100644
--- a/src/main/java/com/schematic/api/resources/accounts/requests/UpdateApiKeyRequestBody.java
+++ b/src/main/java/com/schematic/api/resources/accounts/requests/UpdateApiKeyRequestBody.java
@@ -24,12 +24,18 @@ public final class UpdateApiKeyRequestBody {
private final Optional name;
+ private final Optional rateLimitPercent;
+
private final Map additionalProperties;
private UpdateApiKeyRequestBody(
- Optional description, Optional name, Map additionalProperties) {
+ Optional description,
+ Optional name,
+ Optional rateLimitPercent,
+ Map additionalProperties) {
this.description = description;
this.name = name;
+ this.rateLimitPercent = rateLimitPercent;
this.additionalProperties = additionalProperties;
}
@@ -43,6 +49,11 @@ public Optional getName() {
return name;
}
+ @JsonProperty("rate_limit_percent")
+ public Optional getRateLimitPercent() {
+ return rateLimitPercent;
+ }
+
@java.lang.Override
public boolean equals(Object other) {
if (this == other) return true;
@@ -55,12 +66,14 @@ public Map getAdditionalProperties() {
}
private boolean equalTo(UpdateApiKeyRequestBody other) {
- return description.equals(other.description) && name.equals(other.name);
+ return description.equals(other.description)
+ && name.equals(other.name)
+ && rateLimitPercent.equals(other.rateLimitPercent);
}
@java.lang.Override
public int hashCode() {
- return Objects.hash(this.description, this.name);
+ return Objects.hash(this.description, this.name, this.rateLimitPercent);
}
@java.lang.Override
@@ -78,6 +91,8 @@ public static final class Builder {
private Optional name = Optional.empty();
+ private Optional rateLimitPercent = Optional.empty();
+
@JsonAnySetter
private Map additionalProperties = new HashMap<>();
@@ -86,6 +101,7 @@ private Builder() {}
public Builder from(UpdateApiKeyRequestBody other) {
description(other.getDescription());
name(other.getName());
+ rateLimitPercent(other.getRateLimitPercent());
return this;
}
@@ -111,8 +127,19 @@ public Builder name(String name) {
return this;
}
+ @JsonSetter(value = "rate_limit_percent", nulls = Nulls.SKIP)
+ public Builder rateLimitPercent(Optional rateLimitPercent) {
+ this.rateLimitPercent = rateLimitPercent;
+ return this;
+ }
+
+ public Builder rateLimitPercent(Long rateLimitPercent) {
+ this.rateLimitPercent = Optional.ofNullable(rateLimitPercent);
+ return this;
+ }
+
public UpdateApiKeyRequestBody build() {
- return new UpdateApiKeyRequestBody(description, name, additionalProperties);
+ return new UpdateApiKeyRequestBody(description, name, rateLimitPercent, additionalProperties);
}
public Builder additionalProperty(String key, Object value) {
diff --git a/src/main/java/com/schematic/api/resources/billing/AsyncRawBillingClient.java b/src/main/java/com/schematic/api/resources/billing/AsyncRawBillingClient.java
index 1fe2b63..f0aa328 100644
--- a/src/main/java/com/schematic/api/resources/billing/AsyncRawBillingClient.java
+++ b/src/main/java/com/schematic/api/resources/billing/AsyncRawBillingClient.java
@@ -1768,6 +1768,10 @@ public CompletableFuture> l
QueryStringMapper.addQueryParameter(
httpUrl, "interval", request.getInterval().get(), false);
}
+ if (request.getIntervalCount().isPresent()) {
+ QueryStringMapper.addQueryParameter(
+ httpUrl, "interval_count", request.getIntervalCount().get(), false);
+ }
if (request.getIsActive().isPresent()) {
QueryStringMapper.addQueryParameter(
httpUrl, "is_active", request.getIsActive().get(), false);
@@ -2151,6 +2155,10 @@ public CompletableFuture listBillingPrices(
QueryStringMapper.addQueryParameter(
httpUrl, "interval", request.getInterval().get(), false);
}
+ if (request.getIntervalCount().isPresent()) {
+ QueryStringMapper.addQueryParameter(
+ httpUrl, "interval_count", request.getIntervalCount().get(), false);
+ }
if (request.getIsActive().isPresent()) {
QueryStringMapper.addQueryParameter(
httpUrl, "is_active", request.getIsActive().get(), false);
@@ -1682,6 +1686,10 @@ public BaseSchematicHttpResponse listBillingPr
QueryStringMapper.addQueryParameter(
httpUrl, "interval", request.getInterval().get(), false);
}
+ if (request.getIntervalCount().isPresent()) {
+ QueryStringMapper.addQueryParameter(
+ httpUrl, "interval_count", request.getIntervalCount().get(), false);
+ }
if (request.getIsActive().isPresent()) {
QueryStringMapper.addQueryParameter(
httpUrl, "is_active", request.getIsActive().get(), false);
diff --git a/src/main/java/com/schematic/api/resources/billing/requests/ListBillingPricesRequest.java b/src/main/java/com/schematic/api/resources/billing/requests/ListBillingPricesRequest.java
index 8c46eee..df8f36a 100644
--- a/src/main/java/com/schematic/api/resources/billing/requests/ListBillingPricesRequest.java
+++ b/src/main/java/com/schematic/api/resources/billing/requests/ListBillingPricesRequest.java
@@ -37,6 +37,8 @@ public final class ListBillingPricesRequest {
private final Optional interval;
+ private final Optional intervalCount;
+
private final Optional isActive;
private final Optional planVersionId;
@@ -68,6 +70,7 @@ private ListBillingPricesRequest(
Optional forInitialPlan,
Optional forTrialExpiryPlan,
Optional interval,
+ Optional intervalCount,
Optional isActive,
Optional planVersionId,
Optional price,
@@ -86,6 +89,7 @@ private ListBillingPricesRequest(
this.forInitialPlan = forInitialPlan;
this.forTrialExpiryPlan = forTrialExpiryPlan;
this.interval = interval;
+ this.intervalCount = intervalCount;
this.isActive = isActive;
this.planVersionId = planVersionId;
this.price = price;
@@ -139,6 +143,14 @@ public Optional getInterval() {
return interval;
}
+ /**
+ * @return Filter for prices billed every N intervals; combine with interval (e.g. interval=month, interval_count=3 for quarterly)
+ */
+ @JsonProperty("interval_count")
+ public Optional getIntervalCount() {
+ return intervalCount;
+ }
+
/**
* @return Filter for active prices on active products (defaults to true if not specified)
*/
@@ -227,6 +239,7 @@ private boolean equalTo(ListBillingPricesRequest other) {
&& forInitialPlan.equals(other.forInitialPlan)
&& forTrialExpiryPlan.equals(other.forTrialExpiryPlan)
&& interval.equals(other.interval)
+ && intervalCount.equals(other.intervalCount)
&& isActive.equals(other.isActive)
&& planVersionId.equals(other.planVersionId)
&& price.equals(other.price)
@@ -249,6 +262,7 @@ public int hashCode() {
this.forInitialPlan,
this.forTrialExpiryPlan,
this.interval,
+ this.intervalCount,
this.isActive,
this.planVersionId,
this.price,
@@ -285,6 +299,8 @@ public static final class Builder {
private Optional interval = Optional.empty();
+ private Optional intervalCount = Optional.empty();
+
private Optional isActive = Optional.empty();
private Optional planVersionId = Optional.empty();
@@ -319,6 +335,7 @@ public Builder from(ListBillingPricesRequest other) {
forInitialPlan(other.getForInitialPlan());
forTrialExpiryPlan(other.getForTrialExpiryPlan());
interval(other.getInterval());
+ intervalCount(other.getIntervalCount());
isActive(other.getIsActive());
planVersionId(other.getPlanVersionId());
price(other.getPrice());
@@ -418,6 +435,20 @@ public Builder interval(String interval) {
return this;
}
+ /**
+ * Filter for prices billed every N intervals; combine with interval (e.g. interval=month, interval_count=3 for quarterly)
+ */
+ @JsonSetter(value = "interval_count", nulls = Nulls.SKIP)
+ public Builder intervalCount(Optional intervalCount) {
+ this.intervalCount = intervalCount;
+ return this;
+ }
+
+ public Builder intervalCount(Long intervalCount) {
+ this.intervalCount = Optional.ofNullable(intervalCount);
+ return this;
+ }
+
/**
* Filter for active prices on active products (defaults to true if not specified)
*/
@@ -562,6 +593,7 @@ public ListBillingPricesRequest build() {
forInitialPlan,
forTrialExpiryPlan,
interval,
+ intervalCount,
isActive,
planVersionId,
price,
diff --git a/src/main/java/com/schematic/api/resources/billing/requests/ListBillingProductPricesRequest.java b/src/main/java/com/schematic/api/resources/billing/requests/ListBillingProductPricesRequest.java
index a3451cf..8d5bdf9 100644
--- a/src/main/java/com/schematic/api/resources/billing/requests/ListBillingProductPricesRequest.java
+++ b/src/main/java/com/schematic/api/resources/billing/requests/ListBillingProductPricesRequest.java
@@ -37,6 +37,8 @@ public final class ListBillingProductPricesRequest {
private final Optional interval;
+ private final Optional intervalCount;
+
private final Optional isActive;
private final Optional planVersionId;
@@ -68,6 +70,7 @@ private ListBillingProductPricesRequest(
Optional forInitialPlan,
Optional forTrialExpiryPlan,
Optional interval,
+ Optional intervalCount,
Optional isActive,
Optional planVersionId,
Optional price,
@@ -86,6 +89,7 @@ private ListBillingProductPricesRequest(
this.forInitialPlan = forInitialPlan;
this.forTrialExpiryPlan = forTrialExpiryPlan;
this.interval = interval;
+ this.intervalCount = intervalCount;
this.isActive = isActive;
this.planVersionId = planVersionId;
this.price = price;
@@ -139,6 +143,14 @@ public Optional getInterval() {
return interval;
}
+ /**
+ * @return Filter for prices billed every N intervals; combine with interval (e.g. interval=month, interval_count=3 for quarterly)
+ */
+ @JsonProperty("interval_count")
+ public Optional getIntervalCount() {
+ return intervalCount;
+ }
+
/**
* @return Filter for active prices on active products (defaults to true if not specified)
*/
@@ -227,6 +239,7 @@ private boolean equalTo(ListBillingProductPricesRequest other) {
&& forInitialPlan.equals(other.forInitialPlan)
&& forTrialExpiryPlan.equals(other.forTrialExpiryPlan)
&& interval.equals(other.interval)
+ && intervalCount.equals(other.intervalCount)
&& isActive.equals(other.isActive)
&& planVersionId.equals(other.planVersionId)
&& price.equals(other.price)
@@ -249,6 +262,7 @@ public int hashCode() {
this.forInitialPlan,
this.forTrialExpiryPlan,
this.interval,
+ this.intervalCount,
this.isActive,
this.planVersionId,
this.price,
@@ -285,6 +299,8 @@ public static final class Builder {
private Optional interval = Optional.empty();
+ private Optional intervalCount = Optional.empty();
+
private Optional isActive = Optional.empty();
private Optional planVersionId = Optional.empty();
@@ -319,6 +335,7 @@ public Builder from(ListBillingProductPricesRequest other) {
forInitialPlan(other.getForInitialPlan());
forTrialExpiryPlan(other.getForTrialExpiryPlan());
interval(other.getInterval());
+ intervalCount(other.getIntervalCount());
isActive(other.getIsActive());
planVersionId(other.getPlanVersionId());
price(other.getPrice());
@@ -418,6 +435,20 @@ public Builder interval(String interval) {
return this;
}
+ /**
+ * Filter for prices billed every N intervals; combine with interval (e.g. interval=month, interval_count=3 for quarterly)
+ */
+ @JsonSetter(value = "interval_count", nulls = Nulls.SKIP)
+ public Builder intervalCount(Optional intervalCount) {
+ this.intervalCount = intervalCount;
+ return this;
+ }
+
+ public Builder intervalCount(Long intervalCount) {
+ this.intervalCount = Optional.ofNullable(intervalCount);
+ return this;
+ }
+
/**
* Filter for active prices on active products (defaults to true if not specified)
*/
@@ -562,6 +593,7 @@ public ListBillingProductPricesRequest build() {
forInitialPlan,
forTrialExpiryPlan,
interval,
+ intervalCount,
isActive,
planVersionId,
price,
diff --git a/src/main/java/com/schematic/api/resources/billing/types/ListBillingPricesParams.java b/src/main/java/com/schematic/api/resources/billing/types/ListBillingPricesParams.java
index bbac8de..3a1476f 100644
--- a/src/main/java/com/schematic/api/resources/billing/types/ListBillingPricesParams.java
+++ b/src/main/java/com/schematic/api/resources/billing/types/ListBillingPricesParams.java
@@ -34,6 +34,8 @@ public final class ListBillingPricesParams {
private final Optional interval;
+ private final Optional intervalCount;
+
private final Optional isActive;
private final Optional limit;
@@ -66,6 +68,7 @@ private ListBillingPricesParams(
Optional forTrialExpiryPlan,
Optional> ids,
Optional interval,
+ Optional intervalCount,
Optional isActive,
Optional limit,
Optional offset,
@@ -84,6 +87,7 @@ private ListBillingPricesParams(
this.forTrialExpiryPlan = forTrialExpiryPlan;
this.ids = ids;
this.interval = interval;
+ this.intervalCount = intervalCount;
this.isActive = isActive;
this.limit = limit;
this.offset = offset;
@@ -133,6 +137,14 @@ public Optional getInterval() {
return interval;
}
+ /**
+ * @return Filter for prices billed every N intervals; combine with interval (e.g. interval=month, interval_count=3 for quarterly)
+ */
+ @JsonProperty("interval_count")
+ public Optional getIntervalCount() {
+ return intervalCount;
+ }
+
/**
* @return Filter for active prices on active products (defaults to true if not specified)
*/
@@ -225,6 +237,7 @@ private boolean equalTo(ListBillingPricesParams other) {
&& forTrialExpiryPlan.equals(other.forTrialExpiryPlan)
&& ids.equals(other.ids)
&& interval.equals(other.interval)
+ && intervalCount.equals(other.intervalCount)
&& isActive.equals(other.isActive)
&& limit.equals(other.limit)
&& offset.equals(other.offset)
@@ -247,6 +260,7 @@ public int hashCode() {
this.forTrialExpiryPlan,
this.ids,
this.interval,
+ this.intervalCount,
this.isActive,
this.limit,
this.offset,
@@ -282,6 +296,8 @@ public static final class Builder {
private Optional interval = Optional.empty();
+ private Optional intervalCount = Optional.empty();
+
private Optional isActive = Optional.empty();
private Optional limit = Optional.empty();
@@ -317,6 +333,7 @@ public Builder from(ListBillingPricesParams other) {
forTrialExpiryPlan(other.getForTrialExpiryPlan());
ids(other.getIds());
interval(other.getInterval());
+ intervalCount(other.getIntervalCount());
isActive(other.getIsActive());
limit(other.getLimit());
offset(other.getOffset());
@@ -396,6 +413,20 @@ public Builder interval(String interval) {
return this;
}
+ /**
+ * Filter for prices billed every N intervals; combine with interval (e.g. interval=month, interval_count=3 for quarterly)
+ */
+ @JsonSetter(value = "interval_count", nulls = Nulls.SKIP)
+ public Builder intervalCount(Optional intervalCount) {
+ this.intervalCount = intervalCount;
+ return this;
+ }
+
+ public Builder intervalCount(Long intervalCount) {
+ this.intervalCount = Optional.ofNullable(intervalCount);
+ return this;
+ }
+
/**
* Filter for active prices on active products (defaults to true if not specified)
*/
@@ -550,6 +581,7 @@ public ListBillingPricesParams build() {
forTrialExpiryPlan,
ids,
interval,
+ intervalCount,
isActive,
limit,
offset,
diff --git a/src/main/java/com/schematic/api/resources/billing/types/ListBillingProductPricesParams.java b/src/main/java/com/schematic/api/resources/billing/types/ListBillingProductPricesParams.java
index 0bff5dc..6c74b28 100644
--- a/src/main/java/com/schematic/api/resources/billing/types/ListBillingProductPricesParams.java
+++ b/src/main/java/com/schematic/api/resources/billing/types/ListBillingProductPricesParams.java
@@ -34,6 +34,8 @@ public final class ListBillingProductPricesParams {
private final Optional interval;
+ private final Optional intervalCount;
+
private final Optional isActive;
private final Optional limit;
@@ -66,6 +68,7 @@ private ListBillingProductPricesParams(
Optional forTrialExpiryPlan,
Optional> ids,
Optional interval,
+ Optional intervalCount,
Optional isActive,
Optional limit,
Optional offset,
@@ -84,6 +87,7 @@ private ListBillingProductPricesParams(
this.forTrialExpiryPlan = forTrialExpiryPlan;
this.ids = ids;
this.interval = interval;
+ this.intervalCount = intervalCount;
this.isActive = isActive;
this.limit = limit;
this.offset = offset;
@@ -133,6 +137,14 @@ public Optional getInterval() {
return interval;
}
+ /**
+ * @return Filter for prices billed every N intervals; combine with interval (e.g. interval=month, interval_count=3 for quarterly)
+ */
+ @JsonProperty("interval_count")
+ public Optional getIntervalCount() {
+ return intervalCount;
+ }
+
/**
* @return Filter for active prices on active products (defaults to true if not specified)
*/
@@ -225,6 +237,7 @@ private boolean equalTo(ListBillingProductPricesParams other) {
&& forTrialExpiryPlan.equals(other.forTrialExpiryPlan)
&& ids.equals(other.ids)
&& interval.equals(other.interval)
+ && intervalCount.equals(other.intervalCount)
&& isActive.equals(other.isActive)
&& limit.equals(other.limit)
&& offset.equals(other.offset)
@@ -247,6 +260,7 @@ public int hashCode() {
this.forTrialExpiryPlan,
this.ids,
this.interval,
+ this.intervalCount,
this.isActive,
this.limit,
this.offset,
@@ -282,6 +296,8 @@ public static final class Builder {
private Optional interval = Optional.empty();
+ private Optional intervalCount = Optional.empty();
+
private Optional isActive = Optional.empty();
private Optional limit = Optional.empty();
@@ -317,6 +333,7 @@ public Builder from(ListBillingProductPricesParams other) {
forTrialExpiryPlan(other.getForTrialExpiryPlan());
ids(other.getIds());
interval(other.getInterval());
+ intervalCount(other.getIntervalCount());
isActive(other.getIsActive());
limit(other.getLimit());
offset(other.getOffset());
@@ -396,6 +413,20 @@ public Builder interval(String interval) {
return this;
}
+ /**
+ * Filter for prices billed every N intervals; combine with interval (e.g. interval=month, interval_count=3 for quarterly)
+ */
+ @JsonSetter(value = "interval_count", nulls = Nulls.SKIP)
+ public Builder intervalCount(Optional intervalCount) {
+ this.intervalCount = intervalCount;
+ return this;
+ }
+
+ public Builder intervalCount(Long intervalCount) {
+ this.intervalCount = Optional.ofNullable(intervalCount);
+ return this;
+ }
+
/**
* Filter for active prices on active products (defaults to true if not specified)
*/
@@ -550,6 +581,7 @@ public ListBillingProductPricesParams build() {
forTrialExpiryPlan,
ids,
interval,
+ intervalCount,
isActive,
limit,
offset,
diff --git a/src/main/java/com/schematic/api/resources/catalogs/requests/CreateCatalogRequestBody.java b/src/main/java/com/schematic/api/resources/catalogs/requests/CreateCatalogRequestBody.java
index 3cd18cd..9605a77 100644
--- a/src/main/java/com/schematic/api/resources/catalogs/requests/CreateCatalogRequestBody.java
+++ b/src/main/java/com/schematic/api/resources/catalogs/requests/CreateCatalogRequestBody.java
@@ -23,16 +23,13 @@
public final class CreateCatalogRequestBody {
private final Optional description;
- private final boolean isDefault;
-
private final String name;
private final Map additionalProperties;
private CreateCatalogRequestBody(
- Optional description, boolean isDefault, String name, Map additionalProperties) {
+ Optional description, String name, Map additionalProperties) {
this.description = description;
- this.isDefault = isDefault;
this.name = name;
this.additionalProperties = additionalProperties;
}
@@ -42,11 +39,6 @@ public Optional getDescription() {
return description;
}
- @JsonProperty("is_default")
- public boolean getIsDefault() {
- return isDefault;
- }
-
@JsonProperty("name")
public String getName() {
return name;
@@ -64,12 +56,12 @@ public Map getAdditionalProperties() {
}
private boolean equalTo(CreateCatalogRequestBody other) {
- return description.equals(other.description) && isDefault == other.isDefault && name.equals(other.name);
+ return description.equals(other.description) && name.equals(other.name);
}
@java.lang.Override
public int hashCode() {
- return Objects.hash(this.description, this.isDefault, this.name);
+ return Objects.hash(this.description, this.name);
}
@java.lang.Override
@@ -77,18 +69,14 @@ public String toString() {
return ObjectMappers.stringify(this);
}
- public static IsDefaultStage builder() {
+ public static NameStage builder() {
return new Builder();
}
- public interface IsDefaultStage {
- NameStage isDefault(boolean isDefault);
-
- Builder from(CreateCatalogRequestBody other);
- }
-
public interface NameStage {
_FinalStage name(@NotNull String name);
+
+ Builder from(CreateCatalogRequestBody other);
}
public interface _FinalStage {
@@ -104,9 +92,7 @@ public interface _FinalStage {
}
@JsonIgnoreProperties(ignoreUnknown = true)
- public static final class Builder implements IsDefaultStage, NameStage, _FinalStage {
- private boolean isDefault;
-
+ public static final class Builder implements NameStage, _FinalStage {
private String name;
private Optional description = Optional.empty();
@@ -119,18 +105,10 @@ private Builder() {}
@java.lang.Override
public Builder from(CreateCatalogRequestBody other) {
description(other.getDescription());
- isDefault(other.getIsDefault());
name(other.getName());
return this;
}
- @java.lang.Override
- @JsonSetter("is_default")
- public NameStage isDefault(boolean isDefault) {
- this.isDefault = isDefault;
- return this;
- }
-
@java.lang.Override
@JsonSetter("name")
public _FinalStage name(@NotNull String name) {
@@ -153,7 +131,7 @@ public _FinalStage description(Optional description) {
@java.lang.Override
public CreateCatalogRequestBody build() {
- return new CreateCatalogRequestBody(description, isDefault, name, additionalProperties);
+ return new CreateCatalogRequestBody(description, name, additionalProperties);
}
@java.lang.Override
diff --git a/src/main/java/com/schematic/api/resources/checkout/requests/UpdateCompanyBillingDetailsRequestBody.java b/src/main/java/com/schematic/api/resources/checkout/requests/UpdateCompanyBillingDetailsRequestBody.java
index afa4bcc..9969ba4 100644
--- a/src/main/java/com/schematic/api/resources/checkout/requests/UpdateCompanyBillingDetailsRequestBody.java
+++ b/src/main/java/com/schematic/api/resources/checkout/requests/UpdateCompanyBillingDetailsRequestBody.java
@@ -14,6 +14,7 @@
import com.schematic.api.core.ObjectMappers;
import com.schematic.api.types.CheckoutFieldValue;
import com.schematic.api.types.CustomerBillingAddress;
+import com.schematic.api.types.TaxIdInput;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -30,6 +31,8 @@ public final class UpdateCompanyBillingDetailsRequestBody {
private final Optional phone;
+ private final Optional taxId;
+
private final List values;
private final Map additionalProperties;
@@ -38,11 +41,13 @@ private UpdateCompanyBillingDetailsRequestBody(
Optional address,
Optional email,
Optional phone,
+ Optional taxId,
List values,
Map additionalProperties) {
this.address = address;
this.email = email;
this.phone = phone;
+ this.taxId = taxId;
this.values = values;
this.additionalProperties = additionalProperties;
}
@@ -62,6 +67,11 @@ public Optional getPhone() {
return phone;
}
+ @JsonProperty("tax_id")
+ public Optional getTaxId() {
+ return taxId;
+ }
+
@JsonProperty("values")
public List getValues() {
return values;
@@ -83,12 +93,13 @@ private boolean equalTo(UpdateCompanyBillingDetailsRequestBody other) {
return address.equals(other.address)
&& email.equals(other.email)
&& phone.equals(other.phone)
+ && taxId.equals(other.taxId)
&& values.equals(other.values);
}
@java.lang.Override
public int hashCode() {
- return Objects.hash(this.address, this.email, this.phone, this.values);
+ return Objects.hash(this.address, this.email, this.phone, this.taxId, this.values);
}
@java.lang.Override
@@ -108,6 +119,8 @@ public static final class Builder {
private Optional phone = Optional.empty();
+ private Optional taxId = Optional.empty();
+
private List values = new ArrayList<>();
@JsonAnySetter
@@ -119,6 +132,7 @@ public Builder from(UpdateCompanyBillingDetailsRequestBody other) {
address(other.getAddress());
email(other.getEmail());
phone(other.getPhone());
+ taxId(other.getTaxId());
values(other.getValues());
return this;
}
@@ -156,6 +170,17 @@ public Builder phone(String phone) {
return this;
}
+ @JsonSetter(value = "tax_id", nulls = Nulls.SKIP)
+ public Builder taxId(Optional taxId) {
+ this.taxId = taxId;
+ return this;
+ }
+
+ public Builder taxId(TaxIdInput taxId) {
+ this.taxId = Optional.ofNullable(taxId);
+ return this;
+ }
+
@JsonSetter(value = "values", nulls = Nulls.SKIP)
public Builder values(List values) {
this.values.clear();
@@ -178,7 +203,8 @@ public Builder addAllValues(List values) {
}
public UpdateCompanyBillingDetailsRequestBody build() {
- return new UpdateCompanyBillingDetailsRequestBody(address, email, phone, values, additionalProperties);
+ return new UpdateCompanyBillingDetailsRequestBody(
+ address, email, phone, taxId, values, additionalProperties);
}
public Builder additionalProperty(String key, Object value) {
diff --git a/src/main/java/com/schematic/api/resources/entitlements/AsyncEntitlementsClient.java b/src/main/java/com/schematic/api/resources/entitlements/AsyncEntitlementsClient.java
index c6c374f..735fc81 100644
--- a/src/main/java/com/schematic/api/resources/entitlements/AsyncEntitlementsClient.java
+++ b/src/main/java/com/schematic/api/resources/entitlements/AsyncEntitlementsClient.java
@@ -16,6 +16,8 @@
import com.schematic.api.resources.entitlements.requests.DuplicatePlanEntitlementsRequestBody;
import com.schematic.api.resources.entitlements.requests.GetFeatureUsageByCompanyRequest;
import com.schematic.api.resources.entitlements.requests.GetFeatureUsageTimeSeriesRequest;
+import com.schematic.api.resources.entitlements.requests.GetUserUsageByCompanyRequest;
+import com.schematic.api.resources.entitlements.requests.GetUserUsageDetailRequest;
import com.schematic.api.resources.entitlements.requests.ListCompanyOverridesRequest;
import com.schematic.api.resources.entitlements.requests.ListFeatureCompaniesRequest;
import com.schematic.api.resources.entitlements.requests.ListFeatureUsageRequest;
@@ -37,6 +39,8 @@
import com.schematic.api.resources.entitlements.types.GetFeatureUsageByCompanyResponse;
import com.schematic.api.resources.entitlements.types.GetFeatureUsageTimeSeriesResponse;
import com.schematic.api.resources.entitlements.types.GetPlanEntitlementResponse;
+import com.schematic.api.resources.entitlements.types.GetUserUsageByCompanyResponse;
+import com.schematic.api.resources.entitlements.types.GetUserUsageDetailResponse;
import com.schematic.api.resources.entitlements.types.ListCompanyOverridesResponse;
import com.schematic.api.resources.entitlements.types.ListFeatureCompaniesResponse;
import com.schematic.api.resources.entitlements.types.ListFeatureUsageResponse;
@@ -334,4 +338,23 @@ public CompletableFuture getFeatureUsageByComp
GetFeatureUsageByCompanyRequest request, RequestOptions requestOptions) {
return this.rawClient.getFeatureUsageByCompany(request, requestOptions).thenApply(response -> response.body());
}
+
+ public CompletableFuture getUserUsageByCompany(
+ GetUserUsageByCompanyRequest request) {
+ return this.rawClient.getUserUsageByCompany(request).thenApply(response -> response.body());
+ }
+
+ public CompletableFuture getUserUsageByCompany(
+ GetUserUsageByCompanyRequest request, RequestOptions requestOptions) {
+ return this.rawClient.getUserUsageByCompany(request, requestOptions).thenApply(response -> response.body());
+ }
+
+ public CompletableFuture getUserUsageDetail(GetUserUsageDetailRequest request) {
+ return this.rawClient.getUserUsageDetail(request).thenApply(response -> response.body());
+ }
+
+ public CompletableFuture getUserUsageDetail(
+ GetUserUsageDetailRequest request, RequestOptions requestOptions) {
+ return this.rawClient.getUserUsageDetail(request, requestOptions).thenApply(response -> response.body());
+ }
}
diff --git a/src/main/java/com/schematic/api/resources/entitlements/AsyncRawEntitlementsClient.java b/src/main/java/com/schematic/api/resources/entitlements/AsyncRawEntitlementsClient.java
index b76b7a4..90c32d4 100644
--- a/src/main/java/com/schematic/api/resources/entitlements/AsyncRawEntitlementsClient.java
+++ b/src/main/java/com/schematic/api/resources/entitlements/AsyncRawEntitlementsClient.java
@@ -29,6 +29,8 @@
import com.schematic.api.resources.entitlements.requests.DuplicatePlanEntitlementsRequestBody;
import com.schematic.api.resources.entitlements.requests.GetFeatureUsageByCompanyRequest;
import com.schematic.api.resources.entitlements.requests.GetFeatureUsageTimeSeriesRequest;
+import com.schematic.api.resources.entitlements.requests.GetUserUsageByCompanyRequest;
+import com.schematic.api.resources.entitlements.requests.GetUserUsageDetailRequest;
import com.schematic.api.resources.entitlements.requests.ListCompanyOverridesRequest;
import com.schematic.api.resources.entitlements.requests.ListFeatureCompaniesRequest;
import com.schematic.api.resources.entitlements.requests.ListFeatureUsageRequest;
@@ -50,6 +52,8 @@
import com.schematic.api.resources.entitlements.types.GetFeatureUsageByCompanyResponse;
import com.schematic.api.resources.entitlements.types.GetFeatureUsageTimeSeriesResponse;
import com.schematic.api.resources.entitlements.types.GetPlanEntitlementResponse;
+import com.schematic.api.resources.entitlements.types.GetUserUsageByCompanyResponse;
+import com.schematic.api.resources.entitlements.types.GetUserUsageDetailResponse;
import com.schematic.api.resources.entitlements.types.ListCompanyOverridesResponse;
import com.schematic.api.resources.entitlements.types.ListFeatureCompaniesResponse;
import com.schematic.api.resources.entitlements.types.ListFeatureUsageResponse;
@@ -2622,4 +2626,213 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) {
});
return future;
}
+
+ public CompletableFuture> getUserUsageByCompany(
+ GetUserUsageByCompanyRequest request) {
+ return getUserUsageByCompany(request, null);
+ }
+
+ public CompletableFuture> getUserUsageByCompany(
+ GetUserUsageByCompanyRequest request, RequestOptions requestOptions) {
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ .newBuilder()
+ .addPathSegments("user-usage-by-company");
+ QueryStringMapper.addQueryParameter(httpUrl, "company_id", request.getCompanyId(), false);
+ if (request.getEndTime().isPresent()) {
+ QueryStringMapper.addQueryParameter(
+ httpUrl, "end_time", request.getEndTime().get(), false);
+ }
+ if (request.getFeatureId().isPresent()) {
+ QueryStringMapper.addQueryParameter(
+ httpUrl, "feature_id", request.getFeatureId().get(), false);
+ }
+ if (request.getStartTime().isPresent()) {
+ QueryStringMapper.addQueryParameter(
+ httpUrl, "start_time", request.getStartTime().get(), false);
+ }
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
+ Request.Builder _requestBuilder = new Request.Builder()
+ .url(httpUrl.build())
+ .method("GET", null)
+ .headers(Headers.of(clientOptions.headers(requestOptions)))
+ .addHeader("Accept", "application/json");
+ Request okhttpRequest = _requestBuilder.build();
+ OkHttpClient client = clientOptions.httpClient();
+ if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
+ client = clientOptions.httpClientWithTimeout(requestOptions);
+ }
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
+ CompletableFuture> future = new CompletableFuture<>();
+ client.newCall(okhttpRequest).enqueue(new Callback() {
+ @Override
+ public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException {
+ try (ResponseBody responseBody = response.body()) {
+ String responseBodyString = responseBody != null ? responseBody.string() : "{}";
+ if (response.isSuccessful()) {
+ future.complete(new BaseSchematicHttpResponse<>(
+ ObjectMappers.JSON_MAPPER.readValue(
+ responseBodyString, GetUserUsageByCompanyResponse.class),
+ response));
+ return;
+ }
+ try {
+ switch (response.code()) {
+ case 401:
+ future.completeExceptionally(new UnauthorizedError(
+ ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ApiError.class),
+ response));
+ return;
+ case 403:
+ future.completeExceptionally(new ForbiddenError(
+ ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ApiError.class),
+ response));
+ return;
+ case 404:
+ future.completeExceptionally(new NotFoundError(
+ ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ApiError.class),
+ response));
+ return;
+ case 500:
+ future.completeExceptionally(new InternalServerError(
+ ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ApiError.class),
+ response));
+ return;
+ }
+ } catch (JsonProcessingException ignored) {
+ // unable to map error response, throwing generic error
+ }
+ Object errorBody = ObjectMappers.parseErrorBody(responseBodyString);
+ future.completeExceptionally(new BaseSchematicApiException(
+ "Error with status code " + response.code(), response.code(), errorBody, response));
+ return;
+ } catch (JsonProcessingException e) {
+ future.completeExceptionally(
+ new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e));
+ } catch (IOException e) {
+ future.completeExceptionally(new BaseSchematicException("Network error executing HTTP request", e));
+ }
+ }
+
+ @Override
+ public void onFailure(@NotNull Call call, @NotNull IOException e) {
+ future.completeExceptionally(new BaseSchematicException("Network error executing HTTP request", e));
+ }
+ });
+ return future;
+ }
+
+ public CompletableFuture> getUserUsageDetail(
+ GetUserUsageDetailRequest request) {
+ return getUserUsageDetail(request, null);
+ }
+
+ public CompletableFuture> getUserUsageDetail(
+ GetUserUsageDetailRequest request, RequestOptions requestOptions) {
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ .newBuilder()
+ .addPathSegments("user-usage-detail");
+ QueryStringMapper.addQueryParameter(httpUrl, "company_id", request.getCompanyId(), false);
+ if (request.getEndTime().isPresent()) {
+ QueryStringMapper.addQueryParameter(
+ httpUrl, "end_time", request.getEndTime().get(), false);
+ }
+ if (request.getStartTime().isPresent()) {
+ QueryStringMapper.addQueryParameter(
+ httpUrl, "start_time", request.getStartTime().get(), false);
+ }
+ QueryStringMapper.addQueryParameter(httpUrl, "user_id", request.getUserId(), false);
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
+ Request.Builder _requestBuilder = new Request.Builder()
+ .url(httpUrl.build())
+ .method("GET", null)
+ .headers(Headers.of(clientOptions.headers(requestOptions)))
+ .addHeader("Accept", "application/json");
+ Request okhttpRequest = _requestBuilder.build();
+ OkHttpClient client = clientOptions.httpClient();
+ if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
+ client = clientOptions.httpClientWithTimeout(requestOptions);
+ }
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
+ CompletableFuture> future = new CompletableFuture<>();
+ client.newCall(okhttpRequest).enqueue(new Callback() {
+ @Override
+ public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException {
+ try (ResponseBody responseBody = response.body()) {
+ String responseBodyString = responseBody != null ? responseBody.string() : "{}";
+ if (response.isSuccessful()) {
+ future.complete(new BaseSchematicHttpResponse<>(
+ ObjectMappers.JSON_MAPPER.readValue(
+ responseBodyString, GetUserUsageDetailResponse.class),
+ response));
+ return;
+ }
+ try {
+ switch (response.code()) {
+ case 401:
+ future.completeExceptionally(new UnauthorizedError(
+ ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ApiError.class),
+ response));
+ return;
+ case 403:
+ future.completeExceptionally(new ForbiddenError(
+ ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ApiError.class),
+ response));
+ return;
+ case 404:
+ future.completeExceptionally(new NotFoundError(
+ ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ApiError.class),
+ response));
+ return;
+ case 500:
+ future.completeExceptionally(new InternalServerError(
+ ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ApiError.class),
+ response));
+ return;
+ }
+ } catch (JsonProcessingException ignored) {
+ // unable to map error response, throwing generic error
+ }
+ Object errorBody = ObjectMappers.parseErrorBody(responseBodyString);
+ future.completeExceptionally(new BaseSchematicApiException(
+ "Error with status code " + response.code(), response.code(), errorBody, response));
+ return;
+ } catch (JsonProcessingException e) {
+ future.completeExceptionally(
+ new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e));
+ } catch (IOException e) {
+ future.completeExceptionally(new BaseSchematicException("Network error executing HTTP request", e));
+ }
+ }
+
+ @Override
+ public void onFailure(@NotNull Call call, @NotNull IOException e) {
+ future.completeExceptionally(new BaseSchematicException("Network error executing HTTP request", e));
+ }
+ });
+ return future;
+ }
}
diff --git a/src/main/java/com/schematic/api/resources/entitlements/EntitlementsClient.java b/src/main/java/com/schematic/api/resources/entitlements/EntitlementsClient.java
index eccf611..fa4d7c5 100644
--- a/src/main/java/com/schematic/api/resources/entitlements/EntitlementsClient.java
+++ b/src/main/java/com/schematic/api/resources/entitlements/EntitlementsClient.java
@@ -16,6 +16,8 @@
import com.schematic.api.resources.entitlements.requests.DuplicatePlanEntitlementsRequestBody;
import com.schematic.api.resources.entitlements.requests.GetFeatureUsageByCompanyRequest;
import com.schematic.api.resources.entitlements.requests.GetFeatureUsageTimeSeriesRequest;
+import com.schematic.api.resources.entitlements.requests.GetUserUsageByCompanyRequest;
+import com.schematic.api.resources.entitlements.requests.GetUserUsageDetailRequest;
import com.schematic.api.resources.entitlements.requests.ListCompanyOverridesRequest;
import com.schematic.api.resources.entitlements.requests.ListFeatureCompaniesRequest;
import com.schematic.api.resources.entitlements.requests.ListFeatureUsageRequest;
@@ -37,6 +39,8 @@
import com.schematic.api.resources.entitlements.types.GetFeatureUsageByCompanyResponse;
import com.schematic.api.resources.entitlements.types.GetFeatureUsageTimeSeriesResponse;
import com.schematic.api.resources.entitlements.types.GetPlanEntitlementResponse;
+import com.schematic.api.resources.entitlements.types.GetUserUsageByCompanyResponse;
+import com.schematic.api.resources.entitlements.types.GetUserUsageDetailResponse;
import com.schematic.api.resources.entitlements.types.ListCompanyOverridesResponse;
import com.schematic.api.resources.entitlements.types.ListFeatureCompaniesResponse;
import com.schematic.api.resources.entitlements.types.ListFeatureUsageResponse;
@@ -321,4 +325,22 @@ public GetFeatureUsageByCompanyResponse getFeatureUsageByCompany(
GetFeatureUsageByCompanyRequest request, RequestOptions requestOptions) {
return this.rawClient.getFeatureUsageByCompany(request, requestOptions).body();
}
+
+ public GetUserUsageByCompanyResponse getUserUsageByCompany(GetUserUsageByCompanyRequest request) {
+ return this.rawClient.getUserUsageByCompany(request).body();
+ }
+
+ public GetUserUsageByCompanyResponse getUserUsageByCompany(
+ GetUserUsageByCompanyRequest request, RequestOptions requestOptions) {
+ return this.rawClient.getUserUsageByCompany(request, requestOptions).body();
+ }
+
+ public GetUserUsageDetailResponse getUserUsageDetail(GetUserUsageDetailRequest request) {
+ return this.rawClient.getUserUsageDetail(request).body();
+ }
+
+ public GetUserUsageDetailResponse getUserUsageDetail(
+ GetUserUsageDetailRequest request, RequestOptions requestOptions) {
+ return this.rawClient.getUserUsageDetail(request, requestOptions).body();
+ }
}
diff --git a/src/main/java/com/schematic/api/resources/entitlements/RawEntitlementsClient.java b/src/main/java/com/schematic/api/resources/entitlements/RawEntitlementsClient.java
index 85c3e5c..db5571a 100644
--- a/src/main/java/com/schematic/api/resources/entitlements/RawEntitlementsClient.java
+++ b/src/main/java/com/schematic/api/resources/entitlements/RawEntitlementsClient.java
@@ -29,6 +29,8 @@
import com.schematic.api.resources.entitlements.requests.DuplicatePlanEntitlementsRequestBody;
import com.schematic.api.resources.entitlements.requests.GetFeatureUsageByCompanyRequest;
import com.schematic.api.resources.entitlements.requests.GetFeatureUsageTimeSeriesRequest;
+import com.schematic.api.resources.entitlements.requests.GetUserUsageByCompanyRequest;
+import com.schematic.api.resources.entitlements.requests.GetUserUsageDetailRequest;
import com.schematic.api.resources.entitlements.requests.ListCompanyOverridesRequest;
import com.schematic.api.resources.entitlements.requests.ListFeatureCompaniesRequest;
import com.schematic.api.resources.entitlements.requests.ListFeatureUsageRequest;
@@ -50,6 +52,8 @@
import com.schematic.api.resources.entitlements.types.GetFeatureUsageByCompanyResponse;
import com.schematic.api.resources.entitlements.types.GetFeatureUsageTimeSeriesResponse;
import com.schematic.api.resources.entitlements.types.GetPlanEntitlementResponse;
+import com.schematic.api.resources.entitlements.types.GetUserUsageByCompanyResponse;
+import com.schematic.api.resources.entitlements.types.GetUserUsageDetailResponse;
import com.schematic.api.resources.entitlements.types.ListCompanyOverridesResponse;
import com.schematic.api.resources.entitlements.types.ListFeatureCompaniesResponse;
import com.schematic.api.resources.entitlements.types.ListFeatureUsageResponse;
@@ -2065,4 +2069,166 @@ public BaseSchematicHttpResponse getFeatureUsa
throw new BaseSchematicException("Network error executing HTTP request", e);
}
}
+
+ public BaseSchematicHttpResponse getUserUsageByCompany(
+ GetUserUsageByCompanyRequest request) {
+ return getUserUsageByCompany(request, null);
+ }
+
+ public BaseSchematicHttpResponse getUserUsageByCompany(
+ GetUserUsageByCompanyRequest request, RequestOptions requestOptions) {
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ .newBuilder()
+ .addPathSegments("user-usage-by-company");
+ QueryStringMapper.addQueryParameter(httpUrl, "company_id", request.getCompanyId(), false);
+ if (request.getEndTime().isPresent()) {
+ QueryStringMapper.addQueryParameter(
+ httpUrl, "end_time", request.getEndTime().get(), false);
+ }
+ if (request.getFeatureId().isPresent()) {
+ QueryStringMapper.addQueryParameter(
+ httpUrl, "feature_id", request.getFeatureId().get(), false);
+ }
+ if (request.getStartTime().isPresent()) {
+ QueryStringMapper.addQueryParameter(
+ httpUrl, "start_time", request.getStartTime().get(), false);
+ }
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
+ Request.Builder _requestBuilder = new Request.Builder()
+ .url(httpUrl.build())
+ .method("GET", null)
+ .headers(Headers.of(clientOptions.headers(requestOptions)))
+ .addHeader("Accept", "application/json");
+ Request okhttpRequest = _requestBuilder.build();
+ OkHttpClient client = clientOptions.httpClient();
+ if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
+ client = clientOptions.httpClientWithTimeout(requestOptions);
+ }
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
+ try (Response response = client.newCall(okhttpRequest).execute()) {
+ ResponseBody responseBody = response.body();
+ String responseBodyString = responseBody != null ? responseBody.string() : "{}";
+ if (response.isSuccessful()) {
+ return new BaseSchematicHttpResponse<>(
+ ObjectMappers.JSON_MAPPER.readValue(responseBodyString, GetUserUsageByCompanyResponse.class),
+ response);
+ }
+ try {
+ switch (response.code()) {
+ case 401:
+ throw new UnauthorizedError(
+ ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ApiError.class), response);
+ case 403:
+ throw new ForbiddenError(
+ ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ApiError.class), response);
+ case 404:
+ throw new NotFoundError(
+ ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ApiError.class), response);
+ case 500:
+ throw new InternalServerError(
+ ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ApiError.class), response);
+ }
+ } catch (JsonProcessingException ignored) {
+ // unable to map error response, throwing generic error
+ }
+ Object errorBody = ObjectMappers.parseErrorBody(responseBodyString);
+ throw new BaseSchematicApiException(
+ "Error with status code " + response.code(), response.code(), errorBody, response);
+ } catch (JsonProcessingException e) {
+ throw new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e);
+ } catch (IOException e) {
+ throw new BaseSchematicException("Network error executing HTTP request", e);
+ }
+ }
+
+ public BaseSchematicHttpResponse getUserUsageDetail(GetUserUsageDetailRequest request) {
+ return getUserUsageDetail(request, null);
+ }
+
+ public BaseSchematicHttpResponse getUserUsageDetail(
+ GetUserUsageDetailRequest request, RequestOptions requestOptions) {
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ .newBuilder()
+ .addPathSegments("user-usage-detail");
+ QueryStringMapper.addQueryParameter(httpUrl, "company_id", request.getCompanyId(), false);
+ if (request.getEndTime().isPresent()) {
+ QueryStringMapper.addQueryParameter(
+ httpUrl, "end_time", request.getEndTime().get(), false);
+ }
+ if (request.getStartTime().isPresent()) {
+ QueryStringMapper.addQueryParameter(
+ httpUrl, "start_time", request.getStartTime().get(), false);
+ }
+ QueryStringMapper.addQueryParameter(httpUrl, "user_id", request.getUserId(), false);
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
+ Request.Builder _requestBuilder = new Request.Builder()
+ .url(httpUrl.build())
+ .method("GET", null)
+ .headers(Headers.of(clientOptions.headers(requestOptions)))
+ .addHeader("Accept", "application/json");
+ Request okhttpRequest = _requestBuilder.build();
+ OkHttpClient client = clientOptions.httpClient();
+ if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
+ client = clientOptions.httpClientWithTimeout(requestOptions);
+ }
+ if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
+ okhttpRequest = okhttpRequest
+ .newBuilder()
+ .tag(
+ RetryInterceptor.MaxRetriesOverride.class,
+ new RetryInterceptor.MaxRetriesOverride(
+ requestOptions.getMaxRetries().get()))
+ .build();
+ }
+ try (Response response = client.newCall(okhttpRequest).execute()) {
+ ResponseBody responseBody = response.body();
+ String responseBodyString = responseBody != null ? responseBody.string() : "{}";
+ if (response.isSuccessful()) {
+ return new BaseSchematicHttpResponse<>(
+ ObjectMappers.JSON_MAPPER.readValue(responseBodyString, GetUserUsageDetailResponse.class),
+ response);
+ }
+ try {
+ switch (response.code()) {
+ case 401:
+ throw new UnauthorizedError(
+ ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ApiError.class), response);
+ case 403:
+ throw new ForbiddenError(
+ ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ApiError.class), response);
+ case 404:
+ throw new NotFoundError(
+ ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ApiError.class), response);
+ case 500:
+ throw new InternalServerError(
+ ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ApiError.class), response);
+ }
+ } catch (JsonProcessingException ignored) {
+ // unable to map error response, throwing generic error
+ }
+ Object errorBody = ObjectMappers.parseErrorBody(responseBodyString);
+ throw new BaseSchematicApiException(
+ "Error with status code " + response.code(), response.code(), errorBody, response);
+ } catch (JsonProcessingException e) {
+ throw new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e);
+ } catch (IOException e) {
+ throw new BaseSchematicException("Network error executing HTTP request", e);
+ }
+ }
}
diff --git a/src/main/java/com/schematic/api/resources/entitlements/requests/GetUserUsageByCompanyRequest.java b/src/main/java/com/schematic/api/resources/entitlements/requests/GetUserUsageByCompanyRequest.java
new file mode 100644
index 0000000..472d66b
--- /dev/null
+++ b/src/main/java/com/schematic/api/resources/entitlements/requests/GetUserUsageByCompanyRequest.java
@@ -0,0 +1,262 @@
+/**
+ * This file was auto-generated by Fern from our API Definition.
+ */
+package com.schematic.api.resources.entitlements.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.time.OffsetDateTime;
+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 = GetUserUsageByCompanyRequest.Builder.class)
+public final class GetUserUsageByCompanyRequest {
+ private final String companyId;
+
+ private final Optional endTime;
+
+ private final Optional featureId;
+
+ private final Optional startTime;
+
+ private final Map additionalProperties;
+
+ private GetUserUsageByCompanyRequest(
+ String companyId,
+ Optional endTime,
+ Optional featureId,
+ Optional startTime,
+ Map additionalProperties) {
+ this.companyId = companyId;
+ this.endTime = endTime;
+ this.featureId = featureId;
+ this.startTime = startTime;
+ this.additionalProperties = additionalProperties;
+ }
+
+ /**
+ * @return Company to break usage down for
+ */
+ @JsonProperty("company_id")
+ public String getCompanyId() {
+ return companyId;
+ }
+
+ /**
+ * @return End of the usage window (exclusive); defaults to now
+ */
+ @JsonProperty("end_time")
+ public Optional getEndTime() {
+ return endTime;
+ }
+
+ /**
+ * @return Restrict to a single event-based feature
+ */
+ @JsonProperty("feature_id")
+ public Optional getFeatureId() {
+ return featureId;
+ }
+
+ /**
+ * @return Start of the usage window; defaults to 30 days before the end
+ */
+ @JsonProperty("start_time")
+ public Optional getStartTime() {
+ return startTime;
+ }
+
+ @java.lang.Override
+ public boolean equals(Object other) {
+ if (this == other) return true;
+ return other instanceof GetUserUsageByCompanyRequest && equalTo((GetUserUsageByCompanyRequest) other);
+ }
+
+ @JsonAnyGetter
+ public Map getAdditionalProperties() {
+ return this.additionalProperties;
+ }
+
+ private boolean equalTo(GetUserUsageByCompanyRequest other) {
+ return companyId.equals(other.companyId)
+ && endTime.equals(other.endTime)
+ && featureId.equals(other.featureId)
+ && startTime.equals(other.startTime);
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ return Objects.hash(this.companyId, this.endTime, this.featureId, this.startTime);
+ }
+
+ @java.lang.Override
+ public String toString() {
+ return ObjectMappers.stringify(this);
+ }
+
+ public static CompanyIdStage builder() {
+ return new Builder();
+ }
+
+ public interface CompanyIdStage {
+ /**
+ * Company to break usage down for
+ */
+ _FinalStage companyId(@NotNull String companyId);
+
+ Builder from(GetUserUsageByCompanyRequest other);
+ }
+
+ public interface _FinalStage {
+ GetUserUsageByCompanyRequest build();
+
+ _FinalStage additionalProperty(String key, Object value);
+
+ _FinalStage additionalProperties(Map additionalProperties);
+
+ /**
+ * End of the usage window (exclusive); defaults to now
+ */
+ _FinalStage endTime(Optional endTime);
+
+ _FinalStage endTime(OffsetDateTime endTime);
+
+ /**
+ * Restrict to a single event-based feature
+ */
+ _FinalStage featureId(Optional featureId);
+
+ _FinalStage featureId(String featureId);
+
+ /**
+ * Start of the usage window; defaults to 30 days before the end
+ */
+ _FinalStage startTime(Optional startTime);
+
+ _FinalStage startTime(OffsetDateTime startTime);
+ }
+
+ @JsonIgnoreProperties(ignoreUnknown = true)
+ public static final class Builder implements CompanyIdStage, _FinalStage {
+ private String companyId;
+
+ private Optional startTime = Optional.empty();
+
+ private Optional featureId = Optional.empty();
+
+ private Optional endTime = Optional.empty();
+
+ @JsonAnySetter
+ private Map additionalProperties = new HashMap<>();
+
+ private Builder() {}
+
+ @java.lang.Override
+ public Builder from(GetUserUsageByCompanyRequest other) {
+ companyId(other.getCompanyId());
+ endTime(other.getEndTime());
+ featureId(other.getFeatureId());
+ startTime(other.getStartTime());
+ return this;
+ }
+
+ /**
+ * Company to break usage down for
+ * @return Reference to {@code this} so that method calls can be chained together.
+ */
+ @java.lang.Override
+ @JsonSetter("company_id")
+ public _FinalStage companyId(@NotNull String companyId) {
+ this.companyId = Objects.requireNonNull(companyId, "companyId must not be null");
+ return this;
+ }
+
+ /**
+ * Start of the usage window; defaults to 30 days before the end
+ * @return Reference to {@code this} so that method calls can be chained together.
+ */
+ @java.lang.Override
+ public _FinalStage startTime(OffsetDateTime startTime) {
+ this.startTime = Optional.ofNullable(startTime);
+ return this;
+ }
+
+ /**
+ * Start of the usage window; defaults to 30 days before the end
+ */
+ @java.lang.Override
+ @JsonSetter(value = "start_time", nulls = Nulls.SKIP)
+ public _FinalStage startTime(Optional startTime) {
+ this.startTime = startTime;
+ return this;
+ }
+
+ /**
+ * Restrict to a single event-based feature
+ * @return Reference to {@code this} so that method calls can be chained together.
+ */
+ @java.lang.Override
+ public _FinalStage featureId(String featureId) {
+ this.featureId = Optional.ofNullable(featureId);
+ return this;
+ }
+
+ /**
+ * Restrict to a single event-based feature
+ */
+ @java.lang.Override
+ @JsonSetter(value = "feature_id", nulls = Nulls.SKIP)
+ public _FinalStage featureId(Optional featureId) {
+ this.featureId = featureId;
+ return this;
+ }
+
+ /**
+ * End of the usage window (exclusive); defaults to now
+ * @return Reference to {@code this} so that method calls can be chained together.
+ */
+ @java.lang.Override
+ public _FinalStage endTime(OffsetDateTime endTime) {
+ this.endTime = Optional.ofNullable(endTime);
+ return this;
+ }
+
+ /**
+ * End of the usage window (exclusive); defaults to now
+ */
+ @java.lang.Override
+ @JsonSetter(value = "end_time", nulls = Nulls.SKIP)
+ public _FinalStage endTime(Optional endTime) {
+ this.endTime = endTime;
+ return this;
+ }
+
+ @java.lang.Override
+ public GetUserUsageByCompanyRequest build() {
+ return new GetUserUsageByCompanyRequest(companyId, endTime, featureId, startTime, additionalProperties);
+ }
+
+ @java.lang.Override
+ public Builder additionalProperty(String key, Object value) {
+ this.additionalProperties.put(key, value);
+ return this;
+ }
+
+ @java.lang.Override
+ public Builder additionalProperties(Map additionalProperties) {
+ this.additionalProperties.putAll(additionalProperties);
+ return this;
+ }
+ }
+}
diff --git a/src/main/java/com/schematic/api/resources/entitlements/requests/GetUserUsageDetailRequest.java b/src/main/java/com/schematic/api/resources/entitlements/requests/GetUserUsageDetailRequest.java
new file mode 100644
index 0000000..56ccd7d
--- /dev/null
+++ b/src/main/java/com/schematic/api/resources/entitlements/requests/GetUserUsageDetailRequest.java
@@ -0,0 +1,253 @@
+/**
+ * This file was auto-generated by Fern from our API Definition.
+ */
+package com.schematic.api.resources.entitlements.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.time.OffsetDateTime;
+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 = GetUserUsageDetailRequest.Builder.class)
+public final class GetUserUsageDetailRequest {
+ private final String companyId;
+
+ private final Optional endTime;
+
+ private final Optional startTime;
+
+ private final String userId;
+
+ private final Map additionalProperties;
+
+ private GetUserUsageDetailRequest(
+ String companyId,
+ Optional endTime,
+ Optional startTime,
+ String userId,
+ Map additionalProperties) {
+ this.companyId = companyId;
+ this.endTime = endTime;
+ this.startTime = startTime;
+ this.userId = userId;
+ this.additionalProperties = additionalProperties;
+ }
+
+ /**
+ * @return Company the user belongs to
+ */
+ @JsonProperty("company_id")
+ public String getCompanyId() {
+ return companyId;
+ }
+
+ /**
+ * @return End of the usage window (exclusive); defaults to now
+ */
+ @JsonProperty("end_time")
+ public Optional getEndTime() {
+ return endTime;
+ }
+
+ /**
+ * @return Start of the usage window; defaults to 30 days before the end
+ */
+ @JsonProperty("start_time")
+ public Optional getStartTime() {
+ return startTime;
+ }
+
+ /**
+ * @return User to break usage down for
+ */
+ @JsonProperty("user_id")
+ public String getUserId() {
+ return userId;
+ }
+
+ @java.lang.Override
+ public boolean equals(Object other) {
+ if (this == other) return true;
+ return other instanceof GetUserUsageDetailRequest && equalTo((GetUserUsageDetailRequest) other);
+ }
+
+ @JsonAnyGetter
+ public Map getAdditionalProperties() {
+ return this.additionalProperties;
+ }
+
+ private boolean equalTo(GetUserUsageDetailRequest other) {
+ return companyId.equals(other.companyId)
+ && endTime.equals(other.endTime)
+ && startTime.equals(other.startTime)
+ && userId.equals(other.userId);
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ return Objects.hash(this.companyId, this.endTime, this.startTime, this.userId);
+ }
+
+ @java.lang.Override
+ public String toString() {
+ return ObjectMappers.stringify(this);
+ }
+
+ public static CompanyIdStage builder() {
+ return new Builder();
+ }
+
+ public interface CompanyIdStage {
+ /**
+ * Company the user belongs to
+ */
+ UserIdStage companyId(@NotNull String companyId);
+
+ Builder from(GetUserUsageDetailRequest other);
+ }
+
+ public interface UserIdStage {
+ /**
+ * User to break usage down for
+ */
+ _FinalStage userId(@NotNull String userId);
+ }
+
+ public interface _FinalStage {
+ GetUserUsageDetailRequest build();
+
+ _FinalStage additionalProperty(String key, Object value);
+
+ _FinalStage additionalProperties(Map additionalProperties);
+
+ /**
+ * End of the usage window (exclusive); defaults to now
+ */
+ _FinalStage endTime(Optional endTime);
+
+ _FinalStage endTime(OffsetDateTime endTime);
+
+ /**
+ * Start of the usage window; defaults to 30 days before the end
+ */
+ _FinalStage startTime(Optional startTime);
+
+ _FinalStage startTime(OffsetDateTime startTime);
+ }
+
+ @JsonIgnoreProperties(ignoreUnknown = true)
+ public static final class Builder implements CompanyIdStage, UserIdStage, _FinalStage {
+ private String companyId;
+
+ private String userId;
+
+ private Optional startTime = Optional.empty();
+
+ private Optional endTime = Optional.empty();
+
+ @JsonAnySetter
+ private Map additionalProperties = new HashMap<>();
+
+ private Builder() {}
+
+ @java.lang.Override
+ public Builder from(GetUserUsageDetailRequest other) {
+ companyId(other.getCompanyId());
+ endTime(other.getEndTime());
+ startTime(other.getStartTime());
+ userId(other.getUserId());
+ return this;
+ }
+
+ /**
+ * Company the user belongs to
+ * @return Reference to {@code this} so that method calls can be chained together.
+ */
+ @java.lang.Override
+ @JsonSetter("company_id")
+ public UserIdStage companyId(@NotNull String companyId) {
+ this.companyId = Objects.requireNonNull(companyId, "companyId must not be null");
+ return this;
+ }
+
+ /**
+ * User to break usage down for
+ * @return Reference to {@code this} so that method calls can be chained together.
+ */
+ @java.lang.Override
+ @JsonSetter("user_id")
+ public _FinalStage userId(@NotNull String userId) {
+ this.userId = Objects.requireNonNull(userId, "userId must not be null");
+ return this;
+ }
+
+ /**
+ * Start of the usage window; defaults to 30 days before the end
+ * @return Reference to {@code this} so that method calls can be chained together.
+ */
+ @java.lang.Override
+ public _FinalStage startTime(OffsetDateTime startTime) {
+ this.startTime = Optional.ofNullable(startTime);
+ return this;
+ }
+
+ /**
+ * Start of the usage window; defaults to 30 days before the end
+ */
+ @java.lang.Override
+ @JsonSetter(value = "start_time", nulls = Nulls.SKIP)
+ public _FinalStage startTime(Optional startTime) {
+ this.startTime = startTime;
+ return this;
+ }
+
+ /**
+ * End of the usage window (exclusive); defaults to now
+ * @return Reference to {@code this} so that method calls can be chained together.
+ */
+ @java.lang.Override
+ public _FinalStage endTime(OffsetDateTime endTime) {
+ this.endTime = Optional.ofNullable(endTime);
+ return this;
+ }
+
+ /**
+ * End of the usage window (exclusive); defaults to now
+ */
+ @java.lang.Override
+ @JsonSetter(value = "end_time", nulls = Nulls.SKIP)
+ public _FinalStage endTime(Optional endTime) {
+ this.endTime = endTime;
+ return this;
+ }
+
+ @java.lang.Override
+ public GetUserUsageDetailRequest build() {
+ return new GetUserUsageDetailRequest(companyId, endTime, startTime, userId, additionalProperties);
+ }
+
+ @java.lang.Override
+ public Builder additionalProperty(String key, Object value) {
+ this.additionalProperties.put(key, value);
+ return this;
+ }
+
+ @java.lang.Override
+ public Builder additionalProperties(Map additionalProperties) {
+ this.additionalProperties.putAll(additionalProperties);
+ return this;
+ }
+ }
+}
diff --git a/src/main/java/com/schematic/api/resources/entitlements/types/GetUserUsageByCompanyParams.java b/src/main/java/com/schematic/api/resources/entitlements/types/GetUserUsageByCompanyParams.java
new file mode 100644
index 0000000..e256cb2
--- /dev/null
+++ b/src/main/java/com/schematic/api/resources/entitlements/types/GetUserUsageByCompanyParams.java
@@ -0,0 +1,204 @@
+/**
+ * This file was auto-generated by Fern from our API Definition.
+ */
+package com.schematic.api.resources.entitlements.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.time.OffsetDateTime;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Optional;
+
+@JsonInclude(JsonInclude.Include.NON_ABSENT)
+@JsonDeserialize(builder = GetUserUsageByCompanyParams.Builder.class)
+public final class GetUserUsageByCompanyParams {
+ private final Optional companyId;
+
+ private final Optional endTime;
+
+ private final Optional featureId;
+
+ private final Optional startTime;
+
+ private final Map additionalProperties;
+
+ private GetUserUsageByCompanyParams(
+ Optional companyId,
+ Optional endTime,
+ Optional featureId,
+ Optional startTime,
+ Map additionalProperties) {
+ this.companyId = companyId;
+ this.endTime = endTime;
+ this.featureId = featureId;
+ this.startTime = startTime;
+ this.additionalProperties = additionalProperties;
+ }
+
+ /**
+ * @return Company to break usage down for
+ */
+ @JsonProperty("company_id")
+ public Optional getCompanyId() {
+ return companyId;
+ }
+
+ /**
+ * @return End of the usage window (exclusive); defaults to now
+ */
+ @JsonProperty("end_time")
+ public Optional getEndTime() {
+ return endTime;
+ }
+
+ /**
+ * @return Restrict to a single event-based feature
+ */
+ @JsonProperty("feature_id")
+ public Optional getFeatureId() {
+ return featureId;
+ }
+
+ /**
+ * @return Start of the usage window; defaults to 30 days before the end
+ */
+ @JsonProperty("start_time")
+ public Optional getStartTime() {
+ return startTime;
+ }
+
+ @java.lang.Override
+ public boolean equals(Object other) {
+ if (this == other) return true;
+ return other instanceof GetUserUsageByCompanyParams && equalTo((GetUserUsageByCompanyParams) other);
+ }
+
+ @JsonAnyGetter
+ public Map getAdditionalProperties() {
+ return this.additionalProperties;
+ }
+
+ private boolean equalTo(GetUserUsageByCompanyParams other) {
+ return companyId.equals(other.companyId)
+ && endTime.equals(other.endTime)
+ && featureId.equals(other.featureId)
+ && startTime.equals(other.startTime);
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ return Objects.hash(this.companyId, this.endTime, this.featureId, this.startTime);
+ }
+
+ @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 Optional companyId = Optional.empty();
+
+ private Optional endTime = Optional.empty();
+
+ private Optional featureId = Optional.empty();
+
+ private Optional startTime = Optional.empty();
+
+ @JsonAnySetter
+ private Map additionalProperties = new HashMap<>();
+
+ private Builder() {}
+
+ public Builder from(GetUserUsageByCompanyParams other) {
+ companyId(other.getCompanyId());
+ endTime(other.getEndTime());
+ featureId(other.getFeatureId());
+ startTime(other.getStartTime());
+ return this;
+ }
+
+ /**
+ * Company to break usage down for
+ */
+ @JsonSetter(value = "company_id", nulls = Nulls.SKIP)
+ public Builder companyId(Optional companyId) {
+ this.companyId = companyId;
+ return this;
+ }
+
+ public Builder companyId(String companyId) {
+ this.companyId = Optional.ofNullable(companyId);
+ return this;
+ }
+
+ /**
+ * End of the usage window (exclusive); defaults to now
+ */
+ @JsonSetter(value = "end_time", nulls = Nulls.SKIP)
+ public Builder endTime(Optional endTime) {
+ this.endTime = endTime;
+ return this;
+ }
+
+ public Builder endTime(OffsetDateTime endTime) {
+ this.endTime = Optional.ofNullable(endTime);
+ return this;
+ }
+
+ /**
+ * Restrict to a single event-based feature
+ */
+ @JsonSetter(value = "feature_id", nulls = Nulls.SKIP)
+ public Builder featureId(Optional featureId) {
+ this.featureId = featureId;
+ return this;
+ }
+
+ public Builder featureId(String featureId) {
+ this.featureId = Optional.ofNullable(featureId);
+ return this;
+ }
+
+ /**
+ * Start of the usage window; defaults to 30 days before the end
+ */
+ @JsonSetter(value = "start_time", nulls = Nulls.SKIP)
+ public Builder startTime(Optional startTime) {
+ this.startTime = startTime;
+ return this;
+ }
+
+ public Builder startTime(OffsetDateTime startTime) {
+ this.startTime = Optional.ofNullable(startTime);
+ return this;
+ }
+
+ public GetUserUsageByCompanyParams build() {
+ return new GetUserUsageByCompanyParams(companyId, endTime, featureId, startTime, additionalProperties);
+ }
+
+ public Builder additionalProperty(String key, Object value) {
+ this.additionalProperties.put(key, value);
+ return this;
+ }
+
+ public Builder additionalProperties(Map additionalProperties) {
+ this.additionalProperties.putAll(additionalProperties);
+ return this;
+ }
+ }
+}
diff --git a/src/main/java/com/schematic/api/resources/entitlements/types/GetUserUsageByCompanyResponse.java b/src/main/java/com/schematic/api/resources/entitlements/types/GetUserUsageByCompanyResponse.java
new file mode 100644
index 0000000..bb1d822
--- /dev/null
+++ b/src/main/java/com/schematic/api/resources/entitlements/types/GetUserUsageByCompanyResponse.java
@@ -0,0 +1,154 @@
+/**
+ * This file was auto-generated by Fern from our API Definition.
+ */
+package com.schematic.api.resources.entitlements.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.databind.annotation.JsonDeserialize;
+import com.schematic.api.core.ObjectMappers;
+import com.schematic.api.types.UserUsageByCompanyResponseData;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+import org.jetbrains.annotations.NotNull;
+
+@JsonInclude(JsonInclude.Include.NON_ABSENT)
+@JsonDeserialize(builder = GetUserUsageByCompanyResponse.Builder.class)
+public final class GetUserUsageByCompanyResponse {
+ private final UserUsageByCompanyResponseData data;
+
+ private final GetUserUsageByCompanyParams params;
+
+ private final Map additionalProperties;
+
+ private GetUserUsageByCompanyResponse(
+ UserUsageByCompanyResponseData data,
+ GetUserUsageByCompanyParams params,
+ Map additionalProperties) {
+ this.data = data;
+ this.params = params;
+ this.additionalProperties = additionalProperties;
+ }
+
+ @JsonProperty("data")
+ public UserUsageByCompanyResponseData getData() {
+ return data;
+ }
+
+ /**
+ * @return Input parameters
+ */
+ @JsonProperty("params")
+ public GetUserUsageByCompanyParams getParams() {
+ return params;
+ }
+
+ @java.lang.Override
+ public boolean equals(Object other) {
+ if (this == other) return true;
+ return other instanceof GetUserUsageByCompanyResponse && equalTo((GetUserUsageByCompanyResponse) other);
+ }
+
+ @JsonAnyGetter
+ public Map getAdditionalProperties() {
+ return this.additionalProperties;
+ }
+
+ private boolean equalTo(GetUserUsageByCompanyResponse 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 {
+ ParamsStage data(@NotNull UserUsageByCompanyResponseData data);
+
+ Builder from(GetUserUsageByCompanyResponse other);
+ }
+
+ public interface ParamsStage {
+ /**
+ * Input parameters
+ */
+ _FinalStage params(@NotNull GetUserUsageByCompanyParams params);
+ }
+
+ public interface _FinalStage {
+ GetUserUsageByCompanyResponse build();
+
+ _FinalStage additionalProperty(String key, Object value);
+
+ _FinalStage additionalProperties(Map additionalProperties);
+ }
+
+ @JsonIgnoreProperties(ignoreUnknown = true)
+ public static final class Builder implements DataStage, ParamsStage, _FinalStage {
+ private UserUsageByCompanyResponseData data;
+
+ private GetUserUsageByCompanyParams params;
+
+ @JsonAnySetter
+ private Map additionalProperties = new HashMap<>();
+
+ private Builder() {}
+
+ @java.lang.Override
+ public Builder from(GetUserUsageByCompanyResponse other) {
+ data(other.getData());
+ params(other.getParams());
+ return this;
+ }
+
+ @java.lang.Override
+ @JsonSetter("data")
+ public ParamsStage data(@NotNull UserUsageByCompanyResponseData 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
+ @JsonSetter("params")
+ public _FinalStage params(@NotNull GetUserUsageByCompanyParams params) {
+ this.params = Objects.requireNonNull(params, "params must not be null");
+ return this;
+ }
+
+ @java.lang.Override
+ public GetUserUsageByCompanyResponse build() {
+ return new GetUserUsageByCompanyResponse(data, params, additionalProperties);
+ }
+
+ @java.lang.Override
+ public Builder additionalProperty(String key, Object value) {
+ this.additionalProperties.put(key, value);
+ return this;
+ }
+
+ @java.lang.Override
+ public Builder additionalProperties(Map additionalProperties) {
+ this.additionalProperties.putAll(additionalProperties);
+ return this;
+ }
+ }
+}
diff --git a/src/main/java/com/schematic/api/resources/entitlements/types/GetUserUsageDetailParams.java b/src/main/java/com/schematic/api/resources/entitlements/types/GetUserUsageDetailParams.java
new file mode 100644
index 0000000..e19d50b
--- /dev/null
+++ b/src/main/java/com/schematic/api/resources/entitlements/types/GetUserUsageDetailParams.java
@@ -0,0 +1,204 @@
+/**
+ * This file was auto-generated by Fern from our API Definition.
+ */
+package com.schematic.api.resources.entitlements.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.time.OffsetDateTime;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Optional;
+
+@JsonInclude(JsonInclude.Include.NON_ABSENT)
+@JsonDeserialize(builder = GetUserUsageDetailParams.Builder.class)
+public final class GetUserUsageDetailParams {
+ private final Optional companyId;
+
+ private final Optional endTime;
+
+ private final Optional startTime;
+
+ private final Optional userId;
+
+ private final Map additionalProperties;
+
+ private GetUserUsageDetailParams(
+ Optional companyId,
+ Optional endTime,
+ Optional startTime,
+ Optional userId,
+ Map additionalProperties) {
+ this.companyId = companyId;
+ this.endTime = endTime;
+ this.startTime = startTime;
+ this.userId = userId;
+ this.additionalProperties = additionalProperties;
+ }
+
+ /**
+ * @return Company the user belongs to
+ */
+ @JsonProperty("company_id")
+ public Optional getCompanyId() {
+ return companyId;
+ }
+
+ /**
+ * @return End of the usage window (exclusive); defaults to now
+ */
+ @JsonProperty("end_time")
+ public Optional getEndTime() {
+ return endTime;
+ }
+
+ /**
+ * @return Start of the usage window; defaults to 30 days before the end
+ */
+ @JsonProperty("start_time")
+ public Optional getStartTime() {
+ return startTime;
+ }
+
+ /**
+ * @return User to break usage down for
+ */
+ @JsonProperty("user_id")
+ public Optional getUserId() {
+ return userId;
+ }
+
+ @java.lang.Override
+ public boolean equals(Object other) {
+ if (this == other) return true;
+ return other instanceof GetUserUsageDetailParams && equalTo((GetUserUsageDetailParams) other);
+ }
+
+ @JsonAnyGetter
+ public Map getAdditionalProperties() {
+ return this.additionalProperties;
+ }
+
+ private boolean equalTo(GetUserUsageDetailParams other) {
+ return companyId.equals(other.companyId)
+ && endTime.equals(other.endTime)
+ && startTime.equals(other.startTime)
+ && userId.equals(other.userId);
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ return Objects.hash(this.companyId, this.endTime, this.startTime, this.userId);
+ }
+
+ @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 Optional companyId = Optional.empty();
+
+ private Optional endTime = Optional.empty();
+
+ private Optional startTime = Optional.empty();
+
+ private Optional userId = Optional.empty();
+
+ @JsonAnySetter
+ private Map additionalProperties = new HashMap<>();
+
+ private Builder() {}
+
+ public Builder from(GetUserUsageDetailParams other) {
+ companyId(other.getCompanyId());
+ endTime(other.getEndTime());
+ startTime(other.getStartTime());
+ userId(other.getUserId());
+ return this;
+ }
+
+ /**
+ * Company the user belongs to
+ */
+ @JsonSetter(value = "company_id", nulls = Nulls.SKIP)
+ public Builder companyId(Optional companyId) {
+ this.companyId = companyId;
+ return this;
+ }
+
+ public Builder companyId(String companyId) {
+ this.companyId = Optional.ofNullable(companyId);
+ return this;
+ }
+
+ /**
+ *