diff --git a/.fern/metadata.json b/.fern/metadata.json
index b168005f..9283be5e 100644
--- a/.fern/metadata.json
+++ b/.fern/metadata.json
@@ -1,7 +1,7 @@
{
"cliVersion": "5.50.0",
"generatorName": "fernapi/fern-java-sdk",
- "generatorVersion": "4.32.0",
+ "generatorVersion": "4.32.2",
"generatorConfig": {
"client-class-name": "BaseSchematic",
"generate-unknown-as-json-node": true,
@@ -15,10 +15,10 @@
"testImplementation com.github.codemonstur:embedded-redis:1.4.3"
]
},
- "originGitCommit": "32d45f2e03c55876e040549ec59d6cdd7a39625a",
+ "originGitCommit": "5df5ee39faba7ee0d2fd40aa455ee0a1b1a00034",
"originGitCommitIsDirty": false,
"invokedBy": "ci",
- "requestedVersion": "1.6.4",
+ "requestedVersion": "1.6.5",
"ciProvider": "github",
- "sdkVersion": "1.6.4"
+ "sdkVersion": "1.6.5"
}
\ No newline at end of file
diff --git a/.fern/replay.lock b/.fern/replay.lock
index 57c0b68b..e98ea3a6 100644
--- a/.fern/replay.lock
+++ b/.fern/replay.lock
@@ -102,5 +102,11 @@ generations:
cli_version: unknown
generator_versions:
fernapi/fern-java-sdk: 4.32.0
-current_generation: a8a31b847198cfbadbc41b255b3bfdafd0503992
+ - commit_sha: fd4649e8ef55575e75fe5ed09fe6426977d342c6
+ tree_hash: 08c0bbd7d696fd785f9d3e6a0bf009985fa8183b
+ timestamp: 2026-10-19T10:06:25.708Z
+ cli_version: unknown
+ generator_versions:
+ fernapi/fern-java-sdk: 4.32.2
+current_generation: fd4649e8ef55575e75fe5ed09fe6426977d342c6
patches: []
diff --git a/build.gradle b/build.gradle
index c5338ace..4921cadf 100644
--- a/build.gradle
+++ b/build.gradle
@@ -63,7 +63,7 @@ java {
group = 'com.schematichq'
-version = '1.6.4'
+version = '1.6.5'
jar {
dependsOn(":generatePomFileForMavenPublication")
@@ -94,7 +94,7 @@ publishing {
maven(MavenPublication) {
groupId = 'com.schematichq'
artifactId = 'schematic-java'
- version = '1.6.4'
+ version = '1.6.5'
from components.java
pom {
name = 'Schematic'
diff --git a/reference.md b/reference.md
index 0ef74830..7a189984 100644
--- a/reference.md
+++ b/reference.md
@@ -4045,6 +4045,486 @@ client.billing().upsertBillingSubscription(
+
+
+
+
+client.billing.getCompanyNativeSubscription(companyId) -> GetCompanyNativeSubscriptionResponse
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```java
+client.billing().getCompanyNativeSubscription("company_id");
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**companyId:** `String` — company_id
+
+
+
+
+
+
+
+
+
+
+
+client.billing.listNativeInvoices() -> ListNativeInvoicesResponse
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```java
+client.billing().listNativeInvoices(
+ ListNativeInvoicesRequest
+ .builder()
+ .companyId("company_id")
+ .contractId("contract_id")
+ .documentState(InvoiceDocumentState.CREDITED)
+ .limit(1000000L)
+ .offset(1000000L)
+ .build()
+);
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**companyId:** `Optional`
+
+
+
+
+
+-
+
+**contractId:** `Optional`
+
+
+
+
+
+-
+
+**documentState:** `Optional`
+
+
+
+
+
+-
+
+**limit:** `Optional` — Page limit (default 100)
+
+
+
+
+
+-
+
+**offset:** `Optional` — Page offset (default 0)
+
+
+
+
+
+
+
+
+
+
+
+client.billing.getNativeInvoice(invoiceId) -> GetNativeInvoiceResponse
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```java
+client.billing().getNativeInvoice("invoice_id");
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**invoiceId:** `String` — invoice_id
+
+
+
+
+
+
+
+
+
+
+
+client.billing.exportNativeInvoice(invoiceId) -> InputStream
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```java
+client.billing().exportNativeInvoice("invoice_id");
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**invoiceId:** `String` — invoice_id
+
+
+
+
+
+
+
+
+
+
+
+client.billing.finalizeNativeInvoice(invoiceId) -> FinalizeNativeInvoiceResponse
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```java
+client.billing().finalizeNativeInvoice("invoice_id");
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**invoiceId:** `String` — invoice_id
+
+
+
+
+
+
+
+
+
+
+
+client.billing.markNativeInvoicePaid(invoiceId, request) -> MarkNativeInvoicePaidResponse
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```java
+client.billing().markNativeInvoicePaid(
+ "invoice_id",
+ MarkInvoicePaidRequestBody
+ .builder()
+ .idempotencyKey("idempotency_key")
+ .build()
+);
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**invoiceId:** `String` — invoice_id
+
+
+
+
+
+-
+
+**amount:** `Optional` — Amount paid, in minor units of the invoice's currency. Leave empty to mark the whole remaining amount as paid.
+
+
+
+
+
+-
+
+**idempotencyKey:** `String` — A retry with the same key records the payment once.
+
+
+
+
+
+-
+
+**reference:** `Optional` — A note that identifies the payment, such as a bank transfer reference.
+
+
+
+
+
+-
+
+**settledAt:** `Optional` — When the payment arrived. Defaults to now, and cannot be in the future.
+
+
+
+
+
+
+
+
+
+
+
+client.billing.downloadNativeInvoicePdf(invoiceId) -> InputStream
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```java
+client.billing().downloadNativeInvoicePdf("invoice_id");
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**invoiceId:** `String` — invoice_id
+
+
+
+
+
+
+
+
+
+
+
+client.billing.voidNativeInvoice(invoiceId) -> VoidNativeInvoiceResponse
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```java
+client.billing().voidNativeInvoice("invoice_id");
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**invoiceId:** `String` — invoice_id
+
+
+
+
+
+
+
+
+
+
+
+client.billing.countNativeInvoices() -> CountNativeInvoicesResponse
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```java
+client.billing().countNativeInvoices(
+ CountNativeInvoicesRequest
+ .builder()
+ .companyId("company_id")
+ .contractId("contract_id")
+ .documentState(InvoiceDocumentState.CREDITED)
+ .limit(1000000L)
+ .offset(1000000L)
+ .build()
+);
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**companyId:** `Optional`
+
+
+
+
+
+-
+
+**contractId:** `Optional`
+
+
+
+
+
+-
+
+**documentState:** `Optional`
+
+
+
+
+
+-
+
+**limit:** `Optional` — Page limit (default 100)
+
+
+
+
+
+-
+
+**offset:** `Optional` — Page offset (default 0)
+
+
+
+
+
+
+
@@ -6607,7 +7087,7 @@ client.credits().createCreditSpendPolicy(
-
-**companyId:** `Optional` — The company the cap applies to. Set exactly one of company_id and user_id.
+**companyId:** `Optional` — The company the cap applies in. Alone, it caps the whole company. With user_id, it caps that user's spend in this company. Required with user_id when the user belongs to more than one company.
@@ -6631,7 +7111,7 @@ client.credits().createCreditSpendPolicy(
-
-**userId:** `Optional` — The user the cap applies to. Set exactly one of company_id and user_id.
+**userId:** `Optional` — The user the cap applies to. The user must belong to company_id, and with no company_id, to exactly one company.
@@ -8782,7 +9262,7 @@ client.companies().listCompanies(
-
-**withoutFeatureOverrideFor:** `Optional` — Filter out companies that already have a company override for the specified feature ID
+**withoutFeatureOverrideFor:** `Optional` — Filter out companies that have an unexpired company override for the specified feature ID
@@ -9171,7 +9651,7 @@ client.companies().countCompanies(
-
-**withoutFeatureOverrideFor:** `Optional` — Filter out companies that already have a company override for the specified feature ID
+**withoutFeatureOverrideFor:** `Optional` — Filter out companies that have an unexpired company override for the specified feature ID
@@ -14865,11 +15345,15 @@ client.plans().updateCompanyPlans(
client.plans().listCustomPlanBillings(
ListCustomPlanBillingsRequest
.builder()
+ .planBillingSources(
+ Arrays.asList(PlanBillingSource.AMENDMENT)
+ )
.statuses(
Arrays.asList(CustomPlanBillingStatus.ACTIVE)
)
.companyId("company_id")
.planId("plan_id")
+ .planVersionId("plan_version_id")
.planBillingSource(PlanBillingSource.AMENDMENT)
.status(CustomPlanBillingStatus.ACTIVE)
.limit(1000000L)
@@ -14906,7 +15390,23 @@ client.plans().listCustomPlanBillings(
-
-**planBillingSource:** `Optional` — Filter by the flow that created the billing record: custom_plan for a first publish, amendment for a republish, manage_plan for a standard plan assigned by invoice. Defaults to custom_plan.
+**planVersionId:** `Optional` — Filter by the plan version the billing record was created for
+
+
+
+
+
+-
+
+**planBillingSource:** `Optional` — Filter by the flow that created the billing record: custom_plan for a first publish, amendment for a republish, manage_plan for a standard plan assigned by invoice. Defaults to custom_plan unless plan_billing_sources is set.
+
+
+
+
+
+-
+
+**planBillingSources:** `Optional` — Filter by multiple billing sources. Takes precedence over plan_billing_source.
@@ -16323,135 +16823,56 @@ client.plans().publishPlanVersion(
-
-**activationStrategy:** `Optional` — When the company gets the plan. On a custom-plan republish, on_payment is only accepted when the amendment is invoiced today (migration_strategy immediate, proration_behavior always_invoice, collection_method send_invoice): the company stays on its current version until that invoice is paid.
-
-
-
-
-
--
-
-**address:** `Optional`
-
-
-
-
-
--
-
-**billingCycleAnchor:** `Optional` — The date the subscription's billing period renews on. Only honored on a first publish that starts a subscription.
-
-
-
-
-
--
-
-**billingStartDate:** `Optional` — The date the contract term starts. A past date backdates the subscription so the first invoice covers the term from this date to the renewal date. Requires billing_cycle_anchor. Only honored on a first publish that starts a subscription.
-
-
-
-
-
--
-
-**collectionMethod:** `Optional` — How the invoice a custom-plan republish raises today is collected. send_invoice (the default) issues it for the company to pay; charge_automatically charges the default payment method straight away. Only accepted on a custom-plan republish with migration_strategy immediate and proration_behavior always_invoice.
-
-
-
-
-
--
-
-**couponExternalId:** `Optional` — A Stripe coupon to apply. On a custom-plan republish it discounts the amendment invoice and is only used when that invoice is raised today; it must exist in Stripe. It is attached to the subscription, so a repeating or forever coupon also discounts the renewals that follow.
-
-
-
-
-
--
-
-**customFieldValues:** `Optional
>`
-
-
-
-
-
--
-
-**customerEmail:** `Optional`
+**request:** `PublishPlanVersionRequestBody`
-
-
--
-
-**daysUntilDue:** `Optional` — Payment terms in days. On a custom-plan republish they apply to the amendment invoice only, leave the subscription's renewal terms unchanged, and are only used when that invoice is raised today and sent rather than charged. Defaults to the subscription's terms.
-
-
--
-**excludedCompanyIds:** `List`
-
+
+client.plans.previewPublishPlanVersion(planVersionId, request) -> PreviewPublishPlanVersionResponse
-
-**migrationStrategy:** `PlanVersionMigrationStrategy`
-
-
-
+#### 🔌 Usage
-
-**phone:** `Optional`
-
-
-
-
-
-**prorateFirstPeriod:** `Optional` — When true, the partial period between the subscription starting and its renewal date is billed pro rata straight away. When false that period is free and no invoice is raised until the renewal date. Only applies alongside billing_cycle_anchor. Defaults to true.
-
+```java
+client.plans().previewPublishPlanVersion(
+ "plan_version_id",
+ PublishPlanVersionRequestBody
+ .builder()
+ .migrationStrategy(PlanVersionMigrationStrategy.END_OF_BILLING_PERIOD)
+ .excludedCompanyIds(
+ Arrays.asList("excluded_company_ids")
+ )
+ .build()
+);
+```
-
-
--
-
-**prorationBehavior:** `Optional` — How Stripe handles the price difference when companies are migrated. With migration_strategy immediate, omitted means create_prorations. With end_of_billing_period only none is accepted and means the same as omitting it: the change lands on the renewal boundary, so there is nothing to prorate. With scheduled any value is accepted and omitted means none. Not accepted with leave.
-
-
--
-
-**requireNoMigration:** `Optional` — Refuse the publish if any company would be migrated onto the new version
-
-
-
+#### ⚙️ Parameters
-
-**scheduledAt:** `Optional` — When every company moves, for migration_strategy scheduled. Must be in the future; the migration runs within about a minute of this time. Not accepted with other strategies.
-
-
-
-
-
-**sendInvoice:** `Optional` — Whether Stripe emails the invoice when it is finalized. Defaults to true.
+**planVersionId:** `String` — plan_version_id
@@ -16459,7 +16880,7 @@ client.plans().publishPlanVersion(
-
-**taxId:** `Optional`
+**request:** `PublishPlanVersionRequestBody`
@@ -17981,7 +18402,7 @@ client.features().listFeatures(
-
-**withoutCompanyOverrideFor:** `Optional` — Filter out features that already have a company override for the specified company ID
+**withoutCompanyOverrideFor:** `Optional` — Filter out features that have an unexpired company override for the specified company ID
@@ -18620,7 +19041,7 @@ client.features().countFeatures(
-
-**withoutCompanyOverrideFor:** `Optional` — Filter out features that already have a company override for the specified company ID
+**withoutCompanyOverrideFor:** `Optional` — Filter out features that have an unexpired company override for the specified company ID
@@ -18755,7 +19176,6 @@ client.features().listFlags(
client.features().createFlag(
CreateFlagRequestBody
.builder()
- .defaultValue(true)
.description("description")
.flagType("boolean")
.key("key")
@@ -18845,7 +19265,6 @@ client.features().updateFlag(
"flag_id",
CreateFlagRequestBody
.builder()
- .defaultValue(true)
.description("description")
.flagType("boolean")
.key("key")
@@ -19122,7 +19541,7 @@ client.features().checkAndReserveFlag(
-
-**expiresAt:** `Optional` — When the hold lapses if no track event settles it; defaults to one minute from now and may be at most one hour out. The unspent hold is refunded on expiry
+**expiresAt:** `Optional` — When the hold lapses if no track or inference event settles it; defaults to one minute from now and may be at most one hour out. The unspent hold is refunded on expiry
@@ -19138,7 +19557,7 @@ client.features().checkAndReserveFlag(
-
-**preflight:** `Optional` — Hypothetical usage to evaluate the flag against. When credit_cost names the entitlement's credit, that cost is what gets held; otherwise the hold is the entitlement's consumption rate times quantity, or, when quantity is omitted, times the usage stated here
+**preflight:** `Optional` — Hypothetical usage to evaluate the flag against. When credit_cost names the entitlement's credit, that cost is what gets held; otherwise, when event_quantities names the entitlement's event subtype, the hold is that event priced at the entitlement's consumption rate and quantity rates, and quantity is ignored; otherwise the hold is the entitlement's consumption rate times quantity, or, when quantity is omitted, times the usage stated here
@@ -19146,7 +19565,7 @@ client.features().checkAndReserveFlag(
-
-**quantity:** `Optional` — Units of the feature the operation will consume. Sets the hold size together with the entitlement's consumption rate, and is echoed back on the reservation for the settling track event. When it is omitted the units come from preflight.event_usage.quantity, if that event subtype is the entitlement's, else from preflight.usage, else 1
+**quantity:** `Optional` — Units of the feature the operation will consume. Sets the hold size together with the entitlement's consumption rate, and is echoed back on the reservation for the settling track event. When it is omitted the units come from preflight.event_usage.quantity, if that event subtype is the entitlement's, else from preflight.usage, else 1. Ignored when preflight.event_quantities names the entitlement's event subtype, whose quantity is used instead
diff --git a/src/main/java/com/schematic/api/core/ClientOptions.java b/src/main/java/com/schematic/api/core/ClientOptions.java
index 0d44080f..7d5dedb3 100644
--- a/src/main/java/com/schematic/api/core/ClientOptions.java
+++ b/src/main/java/com/schematic/api/core/ClientOptions.java
@@ -60,10 +60,10 @@ private ClientOptions(
this.headers.putAll(headers);
this.headers.putAll(new HashMap() {
{
- put("User-Agent", "com.schematichq.schematic-java/1.6.4");
+ put("User-Agent", "com.schematichq.schematic-java/1.6.5");
put("X-Fern-Language", "JAVA");
put("X-Fern-SDK-Name", "com.schematichq:schematic-java");
- put("X-Fern-SDK-Version", "1.6.4");
+ put("X-Fern-SDK-Version", "1.6.5");
}
});
this.headerSuppliers = headerSuppliers;
diff --git a/src/main/java/com/schematic/api/resources/accesstokens/requests/IssueTemporaryAccessTokenRequestBody.java b/src/main/java/com/schematic/api/resources/accesstokens/requests/IssueTemporaryAccessTokenRequestBody.java
index b4016135..7bc121f4 100644
--- a/src/main/java/com/schematic/api/resources/accesstokens/requests/IssueTemporaryAccessTokenRequestBody.java
+++ b/src/main/java/com/schematic/api/resources/accesstokens/requests/IssueTemporaryAccessTokenRequestBody.java
@@ -100,7 +100,6 @@ public static final class Builder implements ResourceTypeStage, _FinalStage {
private Map lookup = new LinkedHashMap<>();
- @JsonAnySetter
private Map additionalProperties = new HashMap<>();
private Builder() {}
@@ -148,6 +147,14 @@ public IssueTemporaryAccessTokenRequestBody build() {
return new IssueTemporaryAccessTokenRequestBody(lookup, resourceType, additionalProperties);
}
+ @JsonAnySetter
+ private void putAdditionalPropertyFromJson(String key, Object value) {
+ if (key.equalsIgnoreCase("lookup") || key.equalsIgnoreCase("resource_type")) {
+ return;
+ }
+ this.additionalProperties.put(key, value);
+ }
+
@java.lang.Override
public Builder additionalProperty(String key, Object value) {
this.additionalProperties.put(key, value);
diff --git a/src/main/java/com/schematic/api/resources/accesstokens/types/IssueTemporaryAccessTokenResponse.java b/src/main/java/com/schematic/api/resources/accesstokens/types/IssueTemporaryAccessTokenResponse.java
index 240c0403..1420ba4f 100644
--- a/src/main/java/com/schematic/api/resources/accesstokens/types/IssueTemporaryAccessTokenResponse.java
+++ b/src/main/java/com/schematic/api/resources/accesstokens/types/IssueTemporaryAccessTokenResponse.java
@@ -109,7 +109,6 @@ public static final class Builder implements DataStage, _FinalStage {
private Map params = new LinkedHashMap<>();
- @JsonAnySetter
private Map additionalProperties = new HashMap<>();
private Builder() {}
@@ -168,6 +167,14 @@ public IssueTemporaryAccessTokenResponse build() {
return new IssueTemporaryAccessTokenResponse(data, params, additionalProperties);
}
+ @JsonAnySetter
+ private void putAdditionalPropertyFromJson(String key, Object value) {
+ if (key.equalsIgnoreCase("data") || key.equalsIgnoreCase("params")) {
+ return;
+ }
+ this.additionalProperties.put(key, value);
+ }
+
@java.lang.Override
public Builder additionalProperty(String key, Object value) {
this.additionalProperties.put(key, value);
diff --git a/src/main/java/com/schematic/api/resources/accounts/requests/CountAccountMembersRequest.java b/src/main/java/com/schematic/api/resources/accounts/requests/CountAccountMembersRequest.java
index e43cac0a..028310c7 100644
--- a/src/main/java/com/schematic/api/resources/accounts/requests/CountAccountMembersRequest.java
+++ b/src/main/java/com/schematic/api/resources/accounts/requests/CountAccountMembersRequest.java
@@ -132,7 +132,6 @@ public static final class Builder {
private Optional offset = Optional.empty();
- @JsonAnySetter
private Map additionalProperties = new HashMap<>();
private Builder() {}
@@ -222,6 +221,18 @@ public CountAccountMembersRequest build() {
return new CountAccountMembersRequest(ids, q, role, limit, offset, additionalProperties);
}
+ @JsonAnySetter
+ private void putAdditionalPropertyFromJson(String key, Object value) {
+ if (key.equalsIgnoreCase("ids")
+ || key.equalsIgnoreCase("q")
+ || key.equalsIgnoreCase("role")
+ || key.equalsIgnoreCase("limit")
+ || key.equalsIgnoreCase("offset")) {
+ return;
+ }
+ this.additionalProperties.put(key, value);
+ }
+
public Builder additionalProperty(String key, Object value) {
this.additionalProperties.put(key, value);
return this;
diff --git a/src/main/java/com/schematic/api/resources/accounts/requests/CountApiKeysRequest.java b/src/main/java/com/schematic/api/resources/accounts/requests/CountApiKeysRequest.java
index b1404d55..9a5f6efa 100644
--- a/src/main/java/com/schematic/api/resources/accounts/requests/CountApiKeysRequest.java
+++ b/src/main/java/com/schematic/api/resources/accounts/requests/CountApiKeysRequest.java
@@ -143,7 +143,6 @@ public static final class Builder implements RequireEnvironmentStage, _FinalStag
private Optional environmentId = Optional.empty();
- @JsonAnySetter
private Map additionalProperties = new HashMap<>();
private Builder() {}
@@ -222,6 +221,17 @@ public CountApiKeysRequest build() {
return new CountApiKeysRequest(environmentId, requireEnvironment, limit, offset, additionalProperties);
}
+ @JsonAnySetter
+ private void putAdditionalPropertyFromJson(String key, Object value) {
+ if (key.equalsIgnoreCase("environment_id")
+ || key.equalsIgnoreCase("require_environment")
+ || key.equalsIgnoreCase("limit")
+ || key.equalsIgnoreCase("offset")) {
+ return;
+ }
+ this.additionalProperties.put(key, value);
+ }
+
@java.lang.Override
public Builder additionalProperty(String key, Object value) {
this.additionalProperties.put(key, value);
diff --git a/src/main/java/com/schematic/api/resources/accounts/requests/CountAuditLogsRequest.java b/src/main/java/com/schematic/api/resources/accounts/requests/CountAuditLogsRequest.java
index ac71a48f..58bed38f 100644
--- a/src/main/java/com/schematic/api/resources/accounts/requests/CountAuditLogsRequest.java
+++ b/src/main/java/com/schematic/api/resources/accounts/requests/CountAuditLogsRequest.java
@@ -150,7 +150,6 @@ public static final class Builder {
private Optional offset = Optional.empty();
- @JsonAnySetter
private Map additionalProperties = new HashMap<>();
private Builder() {}
@@ -254,6 +253,20 @@ public CountAuditLogsRequest build() {
actorType, endTime, environmentId, q, startTime, limit, offset, additionalProperties);
}
+ @JsonAnySetter
+ private void putAdditionalPropertyFromJson(String key, Object value) {
+ if (key.equalsIgnoreCase("actor_type")
+ || key.equalsIgnoreCase("end_time")
+ || key.equalsIgnoreCase("environment_id")
+ || key.equalsIgnoreCase("q")
+ || key.equalsIgnoreCase("start_time")
+ || key.equalsIgnoreCase("limit")
+ || key.equalsIgnoreCase("offset")) {
+ return;
+ }
+ this.additionalProperties.put(key, value);
+ }
+
public Builder additionalProperty(String key, Object value) {
this.additionalProperties.put(key, value);
return this;
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 11d4a098..adf516ea 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
@@ -148,7 +148,6 @@ public static final class Builder implements NameStage, _FinalStage {
private Optional description = Optional.empty();
- @JsonAnySetter
private Map additionalProperties = new HashMap<>();
private Builder() {}
@@ -228,6 +227,18 @@ public CreateApiKeyRequestBody build() {
description, environmentId, name, rateLimitPercent, readonly, additionalProperties);
}
+ @JsonAnySetter
+ private void putAdditionalPropertyFromJson(String key, Object value) {
+ if (key.equalsIgnoreCase("description")
+ || key.equalsIgnoreCase("environment_id")
+ || key.equalsIgnoreCase("name")
+ || key.equalsIgnoreCase("rate_limit_percent")
+ || key.equalsIgnoreCase("readonly")) {
+ return;
+ }
+ this.additionalProperties.put(key, value);
+ }
+
@java.lang.Override
public Builder additionalProperty(String key, Object value) {
this.additionalProperties.put(key, value);
diff --git a/src/main/java/com/schematic/api/resources/accounts/requests/CreateEnvironmentRequestBody.java b/src/main/java/com/schematic/api/resources/accounts/requests/CreateEnvironmentRequestBody.java
index 4db6fc90..d229f323 100644
--- a/src/main/java/com/schematic/api/resources/accounts/requests/CreateEnvironmentRequestBody.java
+++ b/src/main/java/com/schematic/api/resources/accounts/requests/CreateEnvironmentRequestBody.java
@@ -96,7 +96,6 @@ public static final class Builder implements EnvironmentTypeStage, NameStage, _F
private String name;
- @JsonAnySetter
private Map additionalProperties = new HashMap<>();
private Builder() {}
@@ -127,6 +126,14 @@ public CreateEnvironmentRequestBody build() {
return new CreateEnvironmentRequestBody(environmentType, name, additionalProperties);
}
+ @JsonAnySetter
+ private void putAdditionalPropertyFromJson(String key, Object value) {
+ if (key.equalsIgnoreCase("environment_type") || key.equalsIgnoreCase("name")) {
+ return;
+ }
+ this.additionalProperties.put(key, value);
+ }
+
@java.lang.Override
public Builder additionalProperty(String key, Object value) {
this.additionalProperties.put(key, value);
diff --git a/src/main/java/com/schematic/api/resources/accounts/requests/ListAccountMembersRequest.java b/src/main/java/com/schematic/api/resources/accounts/requests/ListAccountMembersRequest.java
index e17b7512..d05b75c7 100644
--- a/src/main/java/com/schematic/api/resources/accounts/requests/ListAccountMembersRequest.java
+++ b/src/main/java/com/schematic/api/resources/accounts/requests/ListAccountMembersRequest.java
@@ -132,7 +132,6 @@ public static final class Builder {
private Optional offset = Optional.empty();
- @JsonAnySetter
private Map additionalProperties = new HashMap<>();
private Builder() {}
@@ -222,6 +221,18 @@ public ListAccountMembersRequest build() {
return new ListAccountMembersRequest(ids, q, role, limit, offset, additionalProperties);
}
+ @JsonAnySetter
+ private void putAdditionalPropertyFromJson(String key, Object value) {
+ if (key.equalsIgnoreCase("ids")
+ || key.equalsIgnoreCase("q")
+ || key.equalsIgnoreCase("role")
+ || key.equalsIgnoreCase("limit")
+ || key.equalsIgnoreCase("offset")) {
+ return;
+ }
+ this.additionalProperties.put(key, value);
+ }
+
public Builder additionalProperty(String key, Object value) {
this.additionalProperties.put(key, value);
return this;
diff --git a/src/main/java/com/schematic/api/resources/accounts/requests/ListApiKeysRequest.java b/src/main/java/com/schematic/api/resources/accounts/requests/ListApiKeysRequest.java
index 49734466..c7ed874c 100644
--- a/src/main/java/com/schematic/api/resources/accounts/requests/ListApiKeysRequest.java
+++ b/src/main/java/com/schematic/api/resources/accounts/requests/ListApiKeysRequest.java
@@ -143,7 +143,6 @@ public static final class Builder implements RequireEnvironmentStage, _FinalStag
private Optional environmentId = Optional.empty();
- @JsonAnySetter
private Map additionalProperties = new HashMap<>();
private Builder() {}
@@ -222,6 +221,17 @@ public ListApiKeysRequest build() {
return new ListApiKeysRequest(environmentId, requireEnvironment, limit, offset, additionalProperties);
}
+ @JsonAnySetter
+ private void putAdditionalPropertyFromJson(String key, Object value) {
+ if (key.equalsIgnoreCase("environment_id")
+ || key.equalsIgnoreCase("require_environment")
+ || key.equalsIgnoreCase("limit")
+ || key.equalsIgnoreCase("offset")) {
+ return;
+ }
+ this.additionalProperties.put(key, value);
+ }
+
@java.lang.Override
public Builder additionalProperty(String key, Object value) {
this.additionalProperties.put(key, value);
diff --git a/src/main/java/com/schematic/api/resources/accounts/requests/ListAuditLogsRequest.java b/src/main/java/com/schematic/api/resources/accounts/requests/ListAuditLogsRequest.java
index 6fa63218..9d6761b9 100644
--- a/src/main/java/com/schematic/api/resources/accounts/requests/ListAuditLogsRequest.java
+++ b/src/main/java/com/schematic/api/resources/accounts/requests/ListAuditLogsRequest.java
@@ -150,7 +150,6 @@ public static final class Builder {
private Optional offset = Optional.empty();
- @JsonAnySetter
private Map additionalProperties = new HashMap<>();
private Builder() {}
@@ -254,6 +253,20 @@ public ListAuditLogsRequest build() {
actorType, endTime, environmentId, q, startTime, limit, offset, additionalProperties);
}
+ @JsonAnySetter
+ private void putAdditionalPropertyFromJson(String key, Object value) {
+ if (key.equalsIgnoreCase("actor_type")
+ || key.equalsIgnoreCase("end_time")
+ || key.equalsIgnoreCase("environment_id")
+ || key.equalsIgnoreCase("q")
+ || key.equalsIgnoreCase("start_time")
+ || key.equalsIgnoreCase("limit")
+ || key.equalsIgnoreCase("offset")) {
+ return;
+ }
+ this.additionalProperties.put(key, value);
+ }
+
public Builder additionalProperty(String key, Object value) {
this.additionalProperties.put(key, value);
return this;
diff --git a/src/main/java/com/schematic/api/resources/accounts/requests/ListEnvironmentsRequest.java b/src/main/java/com/schematic/api/resources/accounts/requests/ListEnvironmentsRequest.java
index 26a06165..f5cb840e 100644
--- a/src/main/java/com/schematic/api/resources/accounts/requests/ListEnvironmentsRequest.java
+++ b/src/main/java/com/schematic/api/resources/accounts/requests/ListEnvironmentsRequest.java
@@ -99,7 +99,6 @@ public static final class Builder {
private Optional offset = Optional.empty();
- @JsonAnySetter
private Map additionalProperties = new HashMap<>();
private Builder() {}
@@ -159,6 +158,14 @@ public ListEnvironmentsRequest build() {
return new ListEnvironmentsRequest(ids, limit, offset, additionalProperties);
}
+ @JsonAnySetter
+ private void putAdditionalPropertyFromJson(String key, Object value) {
+ if (key.equalsIgnoreCase("ids") || key.equalsIgnoreCase("limit") || key.equalsIgnoreCase("offset")) {
+ return;
+ }
+ this.additionalProperties.put(key, value);
+ }
+
public Builder additionalProperty(String key, Object value) {
this.additionalProperties.put(key, value);
return this;
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 1c53d921..1eae59ea 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
@@ -93,7 +93,6 @@ public static final class Builder {
private Optional rateLimitPercent = Optional.empty();
- @JsonAnySetter
private Map additionalProperties = new HashMap<>();
private Builder() {}
@@ -142,6 +141,16 @@ public UpdateApiKeyRequestBody build() {
return new UpdateApiKeyRequestBody(description, name, rateLimitPercent, additionalProperties);
}
+ @JsonAnySetter
+ private void putAdditionalPropertyFromJson(String key, Object value) {
+ if (key.equalsIgnoreCase("description")
+ || key.equalsIgnoreCase("name")
+ || key.equalsIgnoreCase("rate_limit_percent")) {
+ return;
+ }
+ this.additionalProperties.put(key, value);
+ }
+
public Builder additionalProperty(String key, Object value) {
this.additionalProperties.put(key, value);
return this;
diff --git a/src/main/java/com/schematic/api/resources/accounts/requests/UpdateEnvironmentRequestBody.java b/src/main/java/com/schematic/api/resources/accounts/requests/UpdateEnvironmentRequestBody.java
index 3d043b46..1049815c 100644
--- a/src/main/java/com/schematic/api/resources/accounts/requests/UpdateEnvironmentRequestBody.java
+++ b/src/main/java/com/schematic/api/resources/accounts/requests/UpdateEnvironmentRequestBody.java
@@ -94,7 +94,6 @@ public static final class Builder {
private Optional requireContextSignature = Optional.empty();
- @JsonAnySetter
private Map additionalProperties = new HashMap<>();
private Builder() {}
@@ -144,6 +143,16 @@ public UpdateEnvironmentRequestBody build() {
environmentType, name, requireContextSignature, additionalProperties);
}
+ @JsonAnySetter
+ private void putAdditionalPropertyFromJson(String key, Object value) {
+ if (key.equalsIgnoreCase("environment_type")
+ || key.equalsIgnoreCase("name")
+ || key.equalsIgnoreCase("require_context_signature")) {
+ return;
+ }
+ this.additionalProperties.put(key, value);
+ }
+
public Builder additionalProperty(String key, Object value) {
this.additionalProperties.put(key, value);
return this;
diff --git a/src/main/java/com/schematic/api/resources/accounts/requests/UpdateOnboardingStateRequestBody.java b/src/main/java/com/schematic/api/resources/accounts/requests/UpdateOnboardingStateRequestBody.java
index fc34b82f..eba859ad 100644
--- a/src/main/java/com/schematic/api/resources/accounts/requests/UpdateOnboardingStateRequestBody.java
+++ b/src/main/java/com/schematic/api/resources/accounts/requests/UpdateOnboardingStateRequestBody.java
@@ -131,7 +131,6 @@ public static final class Builder {
private Optional websiteUrl = Optional.empty();
- @JsonAnySetter
private Map additionalProperties = new HashMap<>();
private Builder() {}
@@ -217,6 +216,19 @@ public UpdateOnboardingStateRequestBody build() {
country, dismissed, path, pricingPageUrl, track, websiteUrl, additionalProperties);
}
+ @JsonAnySetter
+ private void putAdditionalPropertyFromJson(String key, Object value) {
+ if (key.equalsIgnoreCase("country")
+ || key.equalsIgnoreCase("dismissed")
+ || key.equalsIgnoreCase("path")
+ || key.equalsIgnoreCase("pricing_page_url")
+ || key.equalsIgnoreCase("track")
+ || key.equalsIgnoreCase("website_url")) {
+ return;
+ }
+ this.additionalProperties.put(key, value);
+ }
+
public Builder additionalProperty(String key, Object value) {
this.additionalProperties.put(key, value);
return this;
diff --git a/src/main/java/com/schematic/api/resources/accounts/types/CountAccountMembersParams.java b/src/main/java/com/schematic/api/resources/accounts/types/CountAccountMembersParams.java
index bddf655a..8c298437 100644
--- a/src/main/java/com/schematic/api/resources/accounts/types/CountAccountMembersParams.java
+++ b/src/main/java/com/schematic/api/resources/accounts/types/CountAccountMembersParams.java
@@ -131,7 +131,6 @@ public static final class Builder {
private Optional role = Optional.empty();
- @JsonAnySetter
private Map additionalProperties = new HashMap<>();
private Builder() {}
@@ -216,6 +215,18 @@ public CountAccountMembersParams build() {
return new CountAccountMembersParams(ids, limit, offset, q, role, additionalProperties);
}
+ @JsonAnySetter
+ private void putAdditionalPropertyFromJson(String key, Object value) {
+ if (key.equalsIgnoreCase("ids")
+ || key.equalsIgnoreCase("limit")
+ || key.equalsIgnoreCase("offset")
+ || key.equalsIgnoreCase("q")
+ || key.equalsIgnoreCase("role")) {
+ return;
+ }
+ this.additionalProperties.put(key, value);
+ }
+
public Builder additionalProperty(String key, Object value) {
this.additionalProperties.put(key, value);
return this;
diff --git a/src/main/java/com/schematic/api/resources/accounts/types/CountAccountMembersResponse.java b/src/main/java/com/schematic/api/resources/accounts/types/CountAccountMembersResponse.java
index ce7268c2..1cb69ffc 100644
--- a/src/main/java/com/schematic/api/resources/accounts/types/CountAccountMembersResponse.java
+++ b/src/main/java/com/schematic/api/resources/accounts/types/CountAccountMembersResponse.java
@@ -102,7 +102,6 @@ public static final class Builder implements DataStage, ParamsStage, _FinalStage
private CountAccountMembersParams params;
- @JsonAnySetter
private Map additionalProperties = new HashMap<>();
private Builder() {}
@@ -137,6 +136,14 @@ public CountAccountMembersResponse build() {
return new CountAccountMembersResponse(data, params, additionalProperties);
}
+ @JsonAnySetter
+ private void putAdditionalPropertyFromJson(String key, Object value) {
+ if (key.equalsIgnoreCase("data") || key.equalsIgnoreCase("params")) {
+ return;
+ }
+ this.additionalProperties.put(key, value);
+ }
+
@java.lang.Override
public Builder additionalProperty(String key, Object value) {
this.additionalProperties.put(key, value);
diff --git a/src/main/java/com/schematic/api/resources/accounts/types/CountApiKeysParams.java b/src/main/java/com/schematic/api/resources/accounts/types/CountApiKeysParams.java
index 71f9ed43..330a8983 100644
--- a/src/main/java/com/schematic/api/resources/accounts/types/CountApiKeysParams.java
+++ b/src/main/java/com/schematic/api/resources/accounts/types/CountApiKeysParams.java
@@ -111,7 +111,6 @@ public static final class Builder {
private Optional requireEnvironment = Optional.empty();
- @JsonAnySetter
private Map additionalProperties = new HashMap<>();
private Builder() {}
@@ -178,6 +177,17 @@ public CountApiKeysParams build() {
return new CountApiKeysParams(environmentId, limit, offset, requireEnvironment, additionalProperties);
}
+ @JsonAnySetter
+ private void putAdditionalPropertyFromJson(String key, Object value) {
+ if (key.equalsIgnoreCase("environment_id")
+ || key.equalsIgnoreCase("limit")
+ || key.equalsIgnoreCase("offset")
+ || key.equalsIgnoreCase("require_environment")) {
+ return;
+ }
+ this.additionalProperties.put(key, value);
+ }
+
public Builder additionalProperty(String key, Object value) {
this.additionalProperties.put(key, value);
return this;
diff --git a/src/main/java/com/schematic/api/resources/accounts/types/CountApiKeysResponse.java b/src/main/java/com/schematic/api/resources/accounts/types/CountApiKeysResponse.java
index 226716aa..24d38ed0 100644
--- a/src/main/java/com/schematic/api/resources/accounts/types/CountApiKeysResponse.java
+++ b/src/main/java/com/schematic/api/resources/accounts/types/CountApiKeysResponse.java
@@ -102,7 +102,6 @@ public static final class Builder implements DataStage, ParamsStage, _FinalStage
private CountApiKeysParams params;
- @JsonAnySetter
private Map additionalProperties = new HashMap<>();
private Builder() {}
@@ -137,6 +136,14 @@ public CountApiKeysResponse build() {
return new CountApiKeysResponse(data, params, additionalProperties);
}
+ @JsonAnySetter
+ private void putAdditionalPropertyFromJson(String key, Object value) {
+ if (key.equalsIgnoreCase("data") || key.equalsIgnoreCase("params")) {
+ return;
+ }
+ this.additionalProperties.put(key, value);
+ }
+
@java.lang.Override
public Builder additionalProperty(String key, Object value) {
this.additionalProperties.put(key, value);
diff --git a/src/main/java/com/schematic/api/resources/accounts/types/CountAuditLogsParams.java b/src/main/java/com/schematic/api/resources/accounts/types/CountAuditLogsParams.java
index 6a30e918..694d7a7c 100644
--- a/src/main/java/com/schematic/api/resources/accounts/types/CountAuditLogsParams.java
+++ b/src/main/java/com/schematic/api/resources/accounts/types/CountAuditLogsParams.java
@@ -150,7 +150,6 @@ public static final class Builder {
private Optional startTime = Optional.empty();
- @JsonAnySetter
private Map additionalProperties = new HashMap<>();
private Builder() {}
@@ -254,6 +253,20 @@ public CountAuditLogsParams build() {
actorType, endTime, environmentId, limit, offset, q, startTime, additionalProperties);
}
+ @JsonAnySetter
+ private void putAdditionalPropertyFromJson(String key, Object value) {
+ if (key.equalsIgnoreCase("actor_type")
+ || key.equalsIgnoreCase("end_time")
+ || key.equalsIgnoreCase("environment_id")
+ || key.equalsIgnoreCase("limit")
+ || key.equalsIgnoreCase("offset")
+ || key.equalsIgnoreCase("q")
+ || key.equalsIgnoreCase("start_time")) {
+ return;
+ }
+ this.additionalProperties.put(key, value);
+ }
+
public Builder additionalProperty(String key, Object value) {
this.additionalProperties.put(key, value);
return this;
diff --git a/src/main/java/com/schematic/api/resources/accounts/types/CountAuditLogsResponse.java b/src/main/java/com/schematic/api/resources/accounts/types/CountAuditLogsResponse.java
index bae56b88..0c44f9f5 100644
--- a/src/main/java/com/schematic/api/resources/accounts/types/CountAuditLogsResponse.java
+++ b/src/main/java/com/schematic/api/resources/accounts/types/CountAuditLogsResponse.java
@@ -102,7 +102,6 @@ public static final class Builder implements DataStage, ParamsStage, _FinalStage
private CountAuditLogsParams params;
- @JsonAnySetter
private Map additionalProperties = new HashMap<>();
private Builder() {}
@@ -137,6 +136,14 @@ public CountAuditLogsResponse build() {
return new CountAuditLogsResponse(data, params, additionalProperties);
}
+ @JsonAnySetter
+ private void putAdditionalPropertyFromJson(String key, Object value) {
+ if (key.equalsIgnoreCase("data") || key.equalsIgnoreCase("params")) {
+ return;
+ }
+ this.additionalProperties.put(key, value);
+ }
+
@java.lang.Override
public Builder additionalProperty(String key, Object value) {
this.additionalProperties.put(key, value);
diff --git a/src/main/java/com/schematic/api/resources/accounts/types/CreateApiKeyResponse.java b/src/main/java/com/schematic/api/resources/accounts/types/CreateApiKeyResponse.java
index 2bb76385..b6e0708b 100644
--- a/src/main/java/com/schematic/api/resources/accounts/types/CreateApiKeyResponse.java
+++ b/src/main/java/com/schematic/api/resources/accounts/types/CreateApiKeyResponse.java
@@ -107,7 +107,6 @@ public static final class Builder implements DataStage, _FinalStage {
private Map params = new LinkedHashMap<>();
- @JsonAnySetter
private Map additionalProperties = new HashMap<>();
private Builder() {}
@@ -166,6 +165,14 @@ public CreateApiKeyResponse build() {
return new CreateApiKeyResponse(data, params, additionalProperties);
}
+ @JsonAnySetter
+ private void putAdditionalPropertyFromJson(String key, Object value) {
+ if (key.equalsIgnoreCase("data") || key.equalsIgnoreCase("params")) {
+ return;
+ }
+ this.additionalProperties.put(key, value);
+ }
+
@java.lang.Override
public Builder additionalProperty(String key, Object value) {
this.additionalProperties.put(key, value);
diff --git a/src/main/java/com/schematic/api/resources/accounts/types/CreateEnvironmentResponse.java b/src/main/java/com/schematic/api/resources/accounts/types/CreateEnvironmentResponse.java
index 44437309..1dac2388 100644
--- a/src/main/java/com/schematic/api/resources/accounts/types/CreateEnvironmentResponse.java
+++ b/src/main/java/com/schematic/api/resources/accounts/types/CreateEnvironmentResponse.java
@@ -109,7 +109,6 @@ public static final class Builder implements DataStage, _FinalStage {
private Map params = new LinkedHashMap<>();
- @JsonAnySetter
private Map additionalProperties = new HashMap<>();
private Builder() {}
@@ -168,6 +167,14 @@ public CreateEnvironmentResponse build() {
return new CreateEnvironmentResponse(data, params, additionalProperties);
}
+ @JsonAnySetter
+ private void putAdditionalPropertyFromJson(String key, Object value) {
+ if (key.equalsIgnoreCase("data") || key.equalsIgnoreCase("params")) {
+ return;
+ }
+ this.additionalProperties.put(key, value);
+ }
+
@java.lang.Override
public Builder additionalProperty(String key, Object value) {
this.additionalProperties.put(key, value);
diff --git a/src/main/java/com/schematic/api/resources/accounts/types/DeleteApiKeyResponse.java b/src/main/java/com/schematic/api/resources/accounts/types/DeleteApiKeyResponse.java
index f7a372b3..f8eec85f 100644
--- a/src/main/java/com/schematic/api/resources/accounts/types/DeleteApiKeyResponse.java
+++ b/src/main/java/com/schematic/api/resources/accounts/types/DeleteApiKeyResponse.java
@@ -107,7 +107,6 @@ public static final class Builder implements DataStage, _FinalStage {
private Map params = new LinkedHashMap<>();
- @JsonAnySetter
private Map additionalProperties = new HashMap<>();
private Builder() {}
@@ -166,6 +165,14 @@ public DeleteApiKeyResponse build() {
return new DeleteApiKeyResponse(data, params, additionalProperties);
}
+ @JsonAnySetter
+ private void putAdditionalPropertyFromJson(String key, Object value) {
+ if (key.equalsIgnoreCase("data") || key.equalsIgnoreCase("params")) {
+ return;
+ }
+ this.additionalProperties.put(key, value);
+ }
+
@java.lang.Override
public Builder additionalProperty(String key, Object value) {
this.additionalProperties.put(key, value);
diff --git a/src/main/java/com/schematic/api/resources/accounts/types/DeleteEnvironmentResponse.java b/src/main/java/com/schematic/api/resources/accounts/types/DeleteEnvironmentResponse.java
index df5528fe..323421cf 100644
--- a/src/main/java/com/schematic/api/resources/accounts/types/DeleteEnvironmentResponse.java
+++ b/src/main/java/com/schematic/api/resources/accounts/types/DeleteEnvironmentResponse.java
@@ -107,7 +107,6 @@ public static final class Builder implements DataStage, _FinalStage {
private Map params = new LinkedHashMap<>();
- @JsonAnySetter
private Map additionalProperties = new HashMap<>();
private Builder() {}
@@ -166,6 +165,14 @@ public DeleteEnvironmentResponse build() {
return new DeleteEnvironmentResponse(data, params, additionalProperties);
}
+ @JsonAnySetter
+ private void putAdditionalPropertyFromJson(String key, Object value) {
+ if (key.equalsIgnoreCase("data") || key.equalsIgnoreCase("params")) {
+ return;
+ }
+ this.additionalProperties.put(key, value);
+ }
+
@java.lang.Override
public Builder additionalProperty(String key, Object value) {
this.additionalProperties.put(key, value);
diff --git a/src/main/java/com/schematic/api/resources/accounts/types/GetAccountMemberResponse.java b/src/main/java/com/schematic/api/resources/accounts/types/GetAccountMemberResponse.java
index e20552e0..0e5ab7ca 100644
--- a/src/main/java/com/schematic/api/resources/accounts/types/GetAccountMemberResponse.java
+++ b/src/main/java/com/schematic/api/resources/accounts/types/GetAccountMemberResponse.java
@@ -107,7 +107,6 @@ public static final class Builder implements DataStage, _FinalStage {
private Map params = new LinkedHashMap<>();
- @JsonAnySetter
private Map additionalProperties = new HashMap<>();
private Builder() {}
@@ -166,6 +165,14 @@ public GetAccountMemberResponse build() {
return new GetAccountMemberResponse(data, params, additionalProperties);
}
+ @JsonAnySetter
+ private void putAdditionalPropertyFromJson(String key, Object value) {
+ if (key.equalsIgnoreCase("data") || key.equalsIgnoreCase("params")) {
+ return;
+ }
+ this.additionalProperties.put(key, value);
+ }
+
@java.lang.Override
public Builder additionalProperty(String key, Object value) {
this.additionalProperties.put(key, value);
diff --git a/src/main/java/com/schematic/api/resources/accounts/types/GetApiKeyResponse.java b/src/main/java/com/schematic/api/resources/accounts/types/GetApiKeyResponse.java
index fa60d07c..653b3cd3 100644
--- a/src/main/java/com/schematic/api/resources/accounts/types/GetApiKeyResponse.java
+++ b/src/main/java/com/schematic/api/resources/accounts/types/GetApiKeyResponse.java
@@ -107,7 +107,6 @@ public static final class Builder implements DataStage, _FinalStage {
private Map params = new LinkedHashMap<>();
- @JsonAnySetter
private Map additionalProperties = new HashMap<>();
private Builder() {}
@@ -166,6 +165,14 @@ public GetApiKeyResponse build() {
return new GetApiKeyResponse(data, params, additionalProperties);
}
+ @JsonAnySetter
+ private void putAdditionalPropertyFromJson(String key, Object value) {
+ if (key.equalsIgnoreCase("data") || key.equalsIgnoreCase("params")) {
+ return;
+ }
+ this.additionalProperties.put(key, value);
+ }
+
@java.lang.Override
public Builder additionalProperty(String key, Object value) {
this.additionalProperties.put(key, value);
diff --git a/src/main/java/com/schematic/api/resources/accounts/types/GetAuditLogResponse.java b/src/main/java/com/schematic/api/resources/accounts/types/GetAuditLogResponse.java
index a568c09c..d894fe21 100644
--- a/src/main/java/com/schematic/api/resources/accounts/types/GetAuditLogResponse.java
+++ b/src/main/java/com/schematic/api/resources/accounts/types/GetAuditLogResponse.java
@@ -107,7 +107,6 @@ public static final class Builder implements DataStage, _FinalStage {
private Map params = new LinkedHashMap<>();
- @JsonAnySetter
private Map additionalProperties = new HashMap<>();
private Builder() {}
@@ -166,6 +165,14 @@ public GetAuditLogResponse build() {
return new GetAuditLogResponse(data, params, additionalProperties);
}
+ @JsonAnySetter
+ private void putAdditionalPropertyFromJson(String key, Object value) {
+ if (key.equalsIgnoreCase("data") || key.equalsIgnoreCase("params")) {
+ return;
+ }
+ this.additionalProperties.put(key, value);
+ }
+
@java.lang.Override
public Builder additionalProperty(String key, Object value) {
this.additionalProperties.put(key, value);
diff --git a/src/main/java/com/schematic/api/resources/accounts/types/GetEnvironmentResponse.java b/src/main/java/com/schematic/api/resources/accounts/types/GetEnvironmentResponse.java
index 0dfc9399..7543ebdc 100644
--- a/src/main/java/com/schematic/api/resources/accounts/types/GetEnvironmentResponse.java
+++ b/src/main/java/com/schematic/api/resources/accounts/types/GetEnvironmentResponse.java
@@ -107,7 +107,6 @@ public static final class Builder implements DataStage, _FinalStage {
private Map params = new LinkedHashMap<>();
- @JsonAnySetter
private Map additionalProperties = new HashMap<>();
private Builder() {}
@@ -166,6 +165,14 @@ public GetEnvironmentResponse build() {
return new GetEnvironmentResponse(data, params, additionalProperties);
}
+ @JsonAnySetter
+ private void putAdditionalPropertyFromJson(String key, Object value) {
+ if (key.equalsIgnoreCase("data") || key.equalsIgnoreCase("params")) {
+ return;
+ }
+ this.additionalProperties.put(key, value);
+ }
+
@java.lang.Override
public Builder additionalProperty(String key, Object value) {
this.additionalProperties.put(key, value);
diff --git a/src/main/java/com/schematic/api/resources/accounts/types/GetOnboardingStateResponse.java b/src/main/java/com/schematic/api/resources/accounts/types/GetOnboardingStateResponse.java
index f7641a7e..d213c387 100644
--- a/src/main/java/com/schematic/api/resources/accounts/types/GetOnboardingStateResponse.java
+++ b/src/main/java/com/schematic/api/resources/accounts/types/GetOnboardingStateResponse.java
@@ -107,7 +107,6 @@ public static final class Builder implements DataStage, _FinalStage {
private Map params = new LinkedHashMap<>();
- @JsonAnySetter
private Map additionalProperties = new HashMap<>();
private Builder() {}
@@ -166,6 +165,14 @@ public GetOnboardingStateResponse build() {
return new GetOnboardingStateResponse(data, params, additionalProperties);
}
+ @JsonAnySetter
+ private void putAdditionalPropertyFromJson(String key, Object value) {
+ if (key.equalsIgnoreCase("data") || key.equalsIgnoreCase("params")) {
+ return;
+ }
+ this.additionalProperties.put(key, value);
+ }
+
@java.lang.Override
public Builder additionalProperty(String key, Object value) {
this.additionalProperties.put(key, value);
diff --git a/src/main/java/com/schematic/api/resources/accounts/types/GetWhoAmIResponse.java b/src/main/java/com/schematic/api/resources/accounts/types/GetWhoAmIResponse.java
index bf40b71d..97714066 100644
--- a/src/main/java/com/schematic/api/resources/accounts/types/GetWhoAmIResponse.java
+++ b/src/main/java/com/schematic/api/resources/accounts/types/GetWhoAmIResponse.java
@@ -107,7 +107,6 @@ public static final class Builder implements DataStage, _FinalStage {
private Map params = new LinkedHashMap<>();
- @JsonAnySetter
private Map additionalProperties = new HashMap<>();
private Builder() {}
@@ -166,6 +165,14 @@ public GetWhoAmIResponse build() {
return new GetWhoAmIResponse(data, params, additionalProperties);
}
+ @JsonAnySetter
+ private void putAdditionalPropertyFromJson(String key, Object value) {
+ if (key.equalsIgnoreCase("data") || key.equalsIgnoreCase("params")) {
+ return;
+ }
+ this.additionalProperties.put(key, value);
+ }
+
@java.lang.Override
public Builder additionalProperty(String key, Object value) {
this.additionalProperties.put(key, value);
diff --git a/src/main/java/com/schematic/api/resources/accounts/types/ListAccountMembersParams.java b/src/main/java/com/schematic/api/resources/accounts/types/ListAccountMembersParams.java
index 286b24ad..2c0054f7 100644
--- a/src/main/java/com/schematic/api/resources/accounts/types/ListAccountMembersParams.java
+++ b/src/main/java/com/schematic/api/resources/accounts/types/ListAccountMembersParams.java
@@ -131,7 +131,6 @@ public static final class Builder {
private Optional role = Optional.empty();
- @JsonAnySetter
private Map additionalProperties = new HashMap<>();
private Builder() {}
@@ -216,6 +215,18 @@ public ListAccountMembersParams build() {
return new ListAccountMembersParams(ids, limit, offset, q, role, additionalProperties);
}
+ @JsonAnySetter
+ private void putAdditionalPropertyFromJson(String key, Object value) {
+ if (key.equalsIgnoreCase("ids")
+ || key.equalsIgnoreCase("limit")
+ || key.equalsIgnoreCase("offset")
+ || key.equalsIgnoreCase("q")
+ || key.equalsIgnoreCase("role")) {
+ return;
+ }
+ this.additionalProperties.put(key, value);
+ }
+
public Builder additionalProperty(String key, Object value) {
this.additionalProperties.put(key, value);
return this;
diff --git a/src/main/java/com/schematic/api/resources/accounts/types/ListAccountMembersResponse.java b/src/main/java/com/schematic/api/resources/accounts/types/ListAccountMembersResponse.java
index 22cb889a..5e9380fd 100644
--- a/src/main/java/com/schematic/api/resources/accounts/types/ListAccountMembersResponse.java
+++ b/src/main/java/com/schematic/api/resources/accounts/types/ListAccountMembersResponse.java
@@ -109,7 +109,6 @@ public static final class Builder implements ParamsStage, _FinalStage {
private List data = new ArrayList<>();
- @JsonAnySetter
private Map additionalProperties = new HashMap<>();
private Builder() {}
@@ -161,6 +160,14 @@ public ListAccountMembersResponse build() {
return new ListAccountMembersResponse(data, params, additionalProperties);
}
+ @JsonAnySetter
+ private void putAdditionalPropertyFromJson(String key, Object value) {
+ if (key.equalsIgnoreCase("data") || key.equalsIgnoreCase("params")) {
+ return;
+ }
+ this.additionalProperties.put(key, value);
+ }
+
@java.lang.Override
public Builder additionalProperty(String key, Object value) {
this.additionalProperties.put(key, value);
diff --git a/src/main/java/com/schematic/api/resources/accounts/types/ListApiKeysParams.java b/src/main/java/com/schematic/api/resources/accounts/types/ListApiKeysParams.java
index df2bd653..ee741887 100644
--- a/src/main/java/com/schematic/api/resources/accounts/types/ListApiKeysParams.java
+++ b/src/main/java/com/schematic/api/resources/accounts/types/ListApiKeysParams.java
@@ -111,7 +111,6 @@ public static final class Builder {
private Optional requireEnvironment = Optional.empty();
- @JsonAnySetter
private Map additionalProperties = new HashMap<>();
private Builder() {}
@@ -178,6 +177,17 @@ public ListApiKeysParams build() {
return new ListApiKeysParams(environmentId, limit, offset, requireEnvironment, additionalProperties);
}
+ @JsonAnySetter
+ private void putAdditionalPropertyFromJson(String key, Object value) {
+ if (key.equalsIgnoreCase("environment_id")
+ || key.equalsIgnoreCase("limit")
+ || key.equalsIgnoreCase("offset")
+ || key.equalsIgnoreCase("require_environment")) {
+ return;
+ }
+ this.additionalProperties.put(key, value);
+ }
+
public Builder additionalProperty(String key, Object value) {
this.additionalProperties.put(key, value);
return this;
diff --git a/src/main/java/com/schematic/api/resources/accounts/types/ListApiKeysResponse.java b/src/main/java/com/schematic/api/resources/accounts/types/ListApiKeysResponse.java
index 2695cfe2..30602492 100644
--- a/src/main/java/com/schematic/api/resources/accounts/types/ListApiKeysResponse.java
+++ b/src/main/java/com/schematic/api/resources/accounts/types/ListApiKeysResponse.java
@@ -107,7 +107,6 @@ public static final class Builder implements ParamsStage, _FinalStage {
private List data = new ArrayList<>();
- @JsonAnySetter
private Map additionalProperties = new HashMap<>();
private Builder() {}
@@ -159,6 +158,14 @@ public ListApiKeysResponse build() {
return new ListApiKeysResponse(data, params, additionalProperties);
}
+ @JsonAnySetter
+ private void putAdditionalPropertyFromJson(String key, Object value) {
+ if (key.equalsIgnoreCase("data") || key.equalsIgnoreCase("params")) {
+ return;
+ }
+ this.additionalProperties.put(key, value);
+ }
+
@java.lang.Override
public Builder additionalProperty(String key, Object value) {
this.additionalProperties.put(key, value);
diff --git a/src/main/java/com/schematic/api/resources/accounts/types/ListAuditLogsParams.java b/src/main/java/com/schematic/api/resources/accounts/types/ListAuditLogsParams.java
index acf0850f..93b70e60 100644
--- a/src/main/java/com/schematic/api/resources/accounts/types/ListAuditLogsParams.java
+++ b/src/main/java/com/schematic/api/resources/accounts/types/ListAuditLogsParams.java
@@ -150,7 +150,6 @@ public static final class Builder {
private Optional startTime = Optional.empty();
- @JsonAnySetter
private Map additionalProperties = new HashMap<>();
private Builder() {}
@@ -254,6 +253,20 @@ public ListAuditLogsParams build() {
actorType, endTime, environmentId, limit, offset, q, startTime, additionalProperties);
}
+ @JsonAnySetter
+ private void putAdditionalPropertyFromJson(String key, Object value) {
+ if (key.equalsIgnoreCase("actor_type")
+ || key.equalsIgnoreCase("end_time")
+ || key.equalsIgnoreCase("environment_id")
+ || key.equalsIgnoreCase("limit")
+ || key.equalsIgnoreCase("offset")
+ || key.equalsIgnoreCase("q")
+ || key.equalsIgnoreCase("start_time")) {
+ return;
+ }
+ this.additionalProperties.put(key, value);
+ }
+
public Builder additionalProperty(String key, Object value) {
this.additionalProperties.put(key, value);
return this;
diff --git a/src/main/java/com/schematic/api/resources/accounts/types/ListAuditLogsResponse.java b/src/main/java/com/schematic/api/resources/accounts/types/ListAuditLogsResponse.java
index 6cfe13c6..3101933b 100644
--- a/src/main/java/com/schematic/api/resources/accounts/types/ListAuditLogsResponse.java
+++ b/src/main/java/com/schematic/api/resources/accounts/types/ListAuditLogsResponse.java
@@ -107,7 +107,6 @@ public static final class Builder implements ParamsStage, _FinalStage {
private List data = new ArrayList<>();
- @JsonAnySetter
private Map additionalProperties = new HashMap<>();
private Builder() {}
@@ -159,6 +158,14 @@ public ListAuditLogsResponse build() {
return new ListAuditLogsResponse(data, params, additionalProperties);
}
+ @JsonAnySetter
+ private void putAdditionalPropertyFromJson(String key, Object value) {
+ if (key.equalsIgnoreCase("data") || key.equalsIgnoreCase("params")) {
+ return;
+ }
+ this.additionalProperties.put(key, value);
+ }
+
@java.lang.Override
public Builder additionalProperty(String key, Object value) {
this.additionalProperties.put(key, value);
diff --git a/src/main/java/com/schematic/api/resources/accounts/types/ListEnvironmentsParams.java b/src/main/java/com/schematic/api/resources/accounts/types/ListEnvironmentsParams.java
index 3625bb25..eb15525a 100644
--- a/src/main/java/com/schematic/api/resources/accounts/types/ListEnvironmentsParams.java
+++ b/src/main/java/com/schematic/api/resources/accounts/types/ListEnvironmentsParams.java
@@ -98,7 +98,6 @@ public static final class Builder {
private Optional offset = Optional.empty();
- @JsonAnySetter
private Map additionalProperties = new HashMap<>();
private Builder() {}
@@ -153,6 +152,14 @@ public ListEnvironmentsParams build() {
return new ListEnvironmentsParams(ids, limit, offset, additionalProperties);
}
+ @JsonAnySetter
+ private void putAdditionalPropertyFromJson(String key, Object value) {
+ if (key.equalsIgnoreCase("ids") || key.equalsIgnoreCase("limit") || key.equalsIgnoreCase("offset")) {
+ return;
+ }
+ this.additionalProperties.put(key, value);
+ }
+
public Builder additionalProperty(String key, Object value) {
this.additionalProperties.put(key, value);
return this;
diff --git a/src/main/java/com/schematic/api/resources/accounts/types/ListEnvironmentsResponse.java b/src/main/java/com/schematic/api/resources/accounts/types/ListEnvironmentsResponse.java
index 283378d2..6b20a27f 100644
--- a/src/main/java/com/schematic/api/resources/accounts/types/ListEnvironmentsResponse.java
+++ b/src/main/java/com/schematic/api/resources/accounts/types/ListEnvironmentsResponse.java
@@ -109,7 +109,6 @@ public static final class Builder implements ParamsStage, _FinalStage {
private List data = new ArrayList<>();
- @JsonAnySetter
private Map additionalProperties = new HashMap<>();
private Builder() {}
@@ -161,6 +160,14 @@ public ListEnvironmentsResponse build() {
return new ListEnvironmentsResponse(data, params, additionalProperties);
}
+ @JsonAnySetter
+ private void putAdditionalPropertyFromJson(String key, Object value) {
+ if (key.equalsIgnoreCase("data") || key.equalsIgnoreCase("params")) {
+ return;
+ }
+ this.additionalProperties.put(key, value);
+ }
+
@java.lang.Override
public Builder additionalProperty(String key, Object value) {
this.additionalProperties.put(key, value);
diff --git a/src/main/java/com/schematic/api/resources/accounts/types/QuickstartResponse.java b/src/main/java/com/schematic/api/resources/accounts/types/QuickstartResponse.java
index fee300de..05693712 100644
--- a/src/main/java/com/schematic/api/resources/accounts/types/QuickstartResponse.java
+++ b/src/main/java/com/schematic/api/resources/accounts/types/QuickstartResponse.java
@@ -107,7 +107,6 @@ public static final class Builder implements DataStage, _FinalStage {
private Map params = new LinkedHashMap<>();
- @JsonAnySetter
private Map additionalProperties = new HashMap<>();
private Builder() {}
@@ -166,6 +165,14 @@ public QuickstartResponse build() {
return new QuickstartResponse(data, params, additionalProperties);
}
+ @JsonAnySetter
+ private void putAdditionalPropertyFromJson(String key, Object value) {
+ if (key.equalsIgnoreCase("data") || key.equalsIgnoreCase("params")) {
+ return;
+ }
+ this.additionalProperties.put(key, value);
+ }
+
@java.lang.Override
public Builder additionalProperty(String key, Object value) {
this.additionalProperties.put(key, value);
diff --git a/src/main/java/com/schematic/api/resources/accounts/types/UpdateApiKeyResponse.java b/src/main/java/com/schematic/api/resources/accounts/types/UpdateApiKeyResponse.java
index 52ad8783..81cd137c 100644
--- a/src/main/java/com/schematic/api/resources/accounts/types/UpdateApiKeyResponse.java
+++ b/src/main/java/com/schematic/api/resources/accounts/types/UpdateApiKeyResponse.java
@@ -107,7 +107,6 @@ public static final class Builder implements DataStage, _FinalStage {
private Map params = new LinkedHashMap<>();
- @JsonAnySetter
private Map additionalProperties = new HashMap<>();
private Builder() {}
@@ -166,6 +165,14 @@ public UpdateApiKeyResponse build() {
return new UpdateApiKeyResponse(data, params, additionalProperties);
}
+ @JsonAnySetter
+ private void putAdditionalPropertyFromJson(String key, Object value) {
+ if (key.equalsIgnoreCase("data") || key.equalsIgnoreCase("params")) {
+ return;
+ }
+ this.additionalProperties.put(key, value);
+ }
+
@java.lang.Override
public Builder additionalProperty(String key, Object value) {
this.additionalProperties.put(key, value);
diff --git a/src/main/java/com/schematic/api/resources/accounts/types/UpdateEnvironmentResponse.java b/src/main/java/com/schematic/api/resources/accounts/types/UpdateEnvironmentResponse.java
index 30d64672..bb79fe13 100644
--- a/src/main/java/com/schematic/api/resources/accounts/types/UpdateEnvironmentResponse.java
+++ b/src/main/java/com/schematic/api/resources/accounts/types/UpdateEnvironmentResponse.java
@@ -107,7 +107,6 @@ public static final class Builder implements DataStage, _FinalStage {
private Map params = new LinkedHashMap<>();
- @JsonAnySetter
private Map additionalProperties = new HashMap<>();
private Builder() {}
@@ -166,6 +165,14 @@ public UpdateEnvironmentResponse build() {
return new UpdateEnvironmentResponse(data, params, additionalProperties);
}
+ @JsonAnySetter
+ private void putAdditionalPropertyFromJson(String key, Object value) {
+ if (key.equalsIgnoreCase("data") || key.equalsIgnoreCase("params")) {
+ return;
+ }
+ this.additionalProperties.put(key, value);
+ }
+
@java.lang.Override
public Builder additionalProperty(String key, Object value) {
this.additionalProperties.put(key, value);
diff --git a/src/main/java/com/schematic/api/resources/accounts/types/UpdateOnboardingStateResponse.java b/src/main/java/com/schematic/api/resources/accounts/types/UpdateOnboardingStateResponse.java
index e10f76e8..0e2812f5 100644
--- a/src/main/java/com/schematic/api/resources/accounts/types/UpdateOnboardingStateResponse.java
+++ b/src/main/java/com/schematic/api/resources/accounts/types/UpdateOnboardingStateResponse.java
@@ -107,7 +107,6 @@ public static final class Builder implements DataStage, _FinalStage {
private Map params = new LinkedHashMap<>();
- @JsonAnySetter
private Map additionalProperties = new HashMap<>();
private Builder() {}
@@ -166,6 +165,14 @@ public UpdateOnboardingStateResponse build() {
return new UpdateOnboardingStateResponse(data, params, additionalProperties);
}
+ @JsonAnySetter
+ private void putAdditionalPropertyFromJson(String key, Object value) {
+ if (key.equalsIgnoreCase("data") || key.equalsIgnoreCase("params")) {
+ return;
+ }
+ this.additionalProperties.put(key, value);
+ }
+
@java.lang.Override
public Builder additionalProperty(String key, Object value) {
this.additionalProperties.put(key, value);
diff --git a/src/main/java/com/schematic/api/resources/billing/AsyncBillingClient.java b/src/main/java/com/schematic/api/resources/billing/AsyncBillingClient.java
index 3bda0958..1da6a0c4 100644
--- a/src/main/java/com/schematic/api/resources/billing/AsyncBillingClient.java
+++ b/src/main/java/com/schematic/api/resources/billing/AsyncBillingClient.java
@@ -8,6 +8,7 @@
import com.schematic.api.core.RequestOptions;
import com.schematic.api.resources.billing.requests.CountBillingProductsRequest;
import com.schematic.api.resources.billing.requests.CountCustomersRequest;
+import com.schematic.api.resources.billing.requests.CountNativeInvoicesRequest;
import com.schematic.api.resources.billing.requests.CreateBillingCustomerRequestBody;
import com.schematic.api.resources.billing.requests.CreateBillingPriceRequestBody;
import com.schematic.api.resources.billing.requests.CreateBillingProductRequestBody;
@@ -24,18 +25,24 @@
import com.schematic.api.resources.billing.requests.ListCustomersWithSubscriptionsRequest;
import com.schematic.api.resources.billing.requests.ListInvoicesRequest;
import com.schematic.api.resources.billing.requests.ListMetersRequest;
+import com.schematic.api.resources.billing.requests.ListNativeInvoicesRequest;
import com.schematic.api.resources.billing.requests.ListPaymentMethodsRequest;
+import com.schematic.api.resources.billing.requests.MarkInvoicePaidRequestBody;
import com.schematic.api.resources.billing.requests.UpdateBillingSettingsRequestBody;
import com.schematic.api.resources.billing.requests.UpdateCompanyBillingProfileRequestBody;
import com.schematic.api.resources.billing.types.CountBillingProductsResponse;
import com.schematic.api.resources.billing.types.CountCustomersResponse;
+import com.schematic.api.resources.billing.types.CountNativeInvoicesResponse;
import com.schematic.api.resources.billing.types.DeleteBillingCouponResponse;
import com.schematic.api.resources.billing.types.DeleteBillingCustomerResponse;
import com.schematic.api.resources.billing.types.DeleteBillingInvoiceResponse;
import com.schematic.api.resources.billing.types.DeleteBillingProductResponse;
import com.schematic.api.resources.billing.types.DeletePaymentMethodByExternalIdResponse;
import com.schematic.api.resources.billing.types.DeleteProductPriceResponse;
+import com.schematic.api.resources.billing.types.FinalizeNativeInvoiceResponse;
import com.schematic.api.resources.billing.types.GetBillingSettingsResponse;
+import com.schematic.api.resources.billing.types.GetCompanyNativeSubscriptionResponse;
+import com.schematic.api.resources.billing.types.GetNativeInvoiceResponse;
import com.schematic.api.resources.billing.types.ListBillingPricesResponse;
import com.schematic.api.resources.billing.types.ListBillingProductPricesResponse;
import com.schematic.api.resources.billing.types.ListBillingProductsResponse;
@@ -44,7 +51,9 @@
import com.schematic.api.resources.billing.types.ListCustomersWithSubscriptionsResponse;
import com.schematic.api.resources.billing.types.ListInvoicesResponse;
import com.schematic.api.resources.billing.types.ListMetersResponse;
+import com.schematic.api.resources.billing.types.ListNativeInvoicesResponse;
import com.schematic.api.resources.billing.types.ListPaymentMethodsResponse;
+import com.schematic.api.resources.billing.types.MarkNativeInvoicePaidResponse;
import com.schematic.api.resources.billing.types.UpdateBillingSettingsResponse;
import com.schematic.api.resources.billing.types.UpdateCompanyBillingProfileResponse;
import com.schematic.api.resources.billing.types.UpsertBillingCouponResponse;
@@ -55,6 +64,8 @@
import com.schematic.api.resources.billing.types.UpsertBillingSubscriptionResponse;
import com.schematic.api.resources.billing.types.UpsertInvoiceResponse;
import com.schematic.api.resources.billing.types.UpsertPaymentMethodResponse;
+import com.schematic.api.resources.billing.types.VoidNativeInvoiceResponse;
+import java.io.InputStream;
import java.util.concurrent.CompletableFuture;
public class AsyncBillingClient {
@@ -1027,4 +1038,278 @@ public CompletableFuture upsertBillingSubscri
});
return future;
}
+
+ public CompletableFuture getCompanyNativeSubscription(String companyId) {
+ CompletableFuture> rawFuture =
+ this.rawClient.getCompanyNativeSubscription(companyId);
+ CompletableFuture future =
+ rawFuture.thenApply(response -> response.body());
+ future.whenComplete((result_, throwable_) -> {
+ if (future.isCancelled()) {
+ rawFuture.cancel(true);
+ }
+ });
+ return future;
+ }
+
+ public CompletableFuture getCompanyNativeSubscription(
+ String companyId, RequestOptions requestOptions) {
+ CompletableFuture> rawFuture =
+ this.rawClient.getCompanyNativeSubscription(companyId, requestOptions);
+ CompletableFuture future =
+ rawFuture.thenApply(response -> response.body());
+ future.whenComplete((result_, throwable_) -> {
+ if (future.isCancelled()) {
+ rawFuture.cancel(true);
+ }
+ });
+ return future;
+ }
+
+ public CompletableFuture listNativeInvoices() {
+ CompletableFuture> rawFuture =
+ this.rawClient.listNativeInvoices();
+ CompletableFuture future = rawFuture.thenApply(response -> response.body());
+ future.whenComplete((result_, throwable_) -> {
+ if (future.isCancelled()) {
+ rawFuture.cancel(true);
+ }
+ });
+ return future;
+ }
+
+ public CompletableFuture listNativeInvoices(RequestOptions requestOptions) {
+ CompletableFuture> rawFuture =
+ this.rawClient.listNativeInvoices(requestOptions);
+ CompletableFuture future = rawFuture.thenApply(response -> response.body());
+ future.whenComplete((result_, throwable_) -> {
+ if (future.isCancelled()) {
+ rawFuture.cancel(true);
+ }
+ });
+ return future;
+ }
+
+ public CompletableFuture listNativeInvoices(ListNativeInvoicesRequest request) {
+ CompletableFuture> rawFuture =
+ this.rawClient.listNativeInvoices(request);
+ CompletableFuture future = rawFuture.thenApply(response -> response.body());
+ future.whenComplete((result_, throwable_) -> {
+ if (future.isCancelled()) {
+ rawFuture.cancel(true);
+ }
+ });
+ return future;
+ }
+
+ public CompletableFuture listNativeInvoices(
+ ListNativeInvoicesRequest request, RequestOptions requestOptions) {
+ CompletableFuture> rawFuture =
+ this.rawClient.listNativeInvoices(request, requestOptions);
+ CompletableFuture future = rawFuture.thenApply(response -> response.body());
+ future.whenComplete((result_, throwable_) -> {
+ if (future.isCancelled()) {
+ rawFuture.cancel(true);
+ }
+ });
+ return future;
+ }
+
+ public CompletableFuture getNativeInvoice(String invoiceId) {
+ CompletableFuture> rawFuture =
+ this.rawClient.getNativeInvoice(invoiceId);
+ CompletableFuture future = rawFuture.thenApply(response -> response.body());
+ future.whenComplete((result_, throwable_) -> {
+ if (future.isCancelled()) {
+ rawFuture.cancel(true);
+ }
+ });
+ return future;
+ }
+
+ public CompletableFuture getNativeInvoice(
+ String invoiceId, RequestOptions requestOptions) {
+ CompletableFuture> rawFuture =
+ this.rawClient.getNativeInvoice(invoiceId, requestOptions);
+ CompletableFuture future = rawFuture.thenApply(response -> response.body());
+ future.whenComplete((result_, throwable_) -> {
+ if (future.isCancelled()) {
+ rawFuture.cancel(true);
+ }
+ });
+ return future;
+ }
+
+ public CompletableFuture exportNativeInvoice(String invoiceId) {
+ CompletableFuture> rawFuture =
+ this.rawClient.exportNativeInvoice(invoiceId);
+ CompletableFuture future = rawFuture.thenApply(response -> response.body());
+ future.whenComplete((result_, throwable_) -> {
+ if (future.isCancelled()) {
+ rawFuture.cancel(true);
+ }
+ });
+ return future;
+ }
+
+ public CompletableFuture exportNativeInvoice(String invoiceId, RequestOptions requestOptions) {
+ CompletableFuture> rawFuture =
+ this.rawClient.exportNativeInvoice(invoiceId, requestOptions);
+ CompletableFuture future = rawFuture.thenApply(response -> response.body());
+ future.whenComplete((result_, throwable_) -> {
+ if (future.isCancelled()) {
+ rawFuture.cancel(true);
+ }
+ });
+ return future;
+ }
+
+ public CompletableFuture finalizeNativeInvoice(String invoiceId) {
+ CompletableFuture> rawFuture =
+ this.rawClient.finalizeNativeInvoice(invoiceId);
+ CompletableFuture future = rawFuture.thenApply(response -> response.body());
+ future.whenComplete((result_, throwable_) -> {
+ if (future.isCancelled()) {
+ rawFuture.cancel(true);
+ }
+ });
+ return future;
+ }
+
+ public CompletableFuture finalizeNativeInvoice(
+ String invoiceId, RequestOptions requestOptions) {
+ CompletableFuture> rawFuture =
+ this.rawClient.finalizeNativeInvoice(invoiceId, requestOptions);
+ CompletableFuture future = rawFuture.thenApply(response -> response.body());
+ future.whenComplete((result_, throwable_) -> {
+ if (future.isCancelled()) {
+ rawFuture.cancel(true);
+ }
+ });
+ return future;
+ }
+
+ public CompletableFuture markNativeInvoicePaid(
+ String invoiceId, MarkInvoicePaidRequestBody request) {
+ CompletableFuture> rawFuture =
+ this.rawClient.markNativeInvoicePaid(invoiceId, request);
+ CompletableFuture future = rawFuture.thenApply(response -> response.body());
+ future.whenComplete((result_, throwable_) -> {
+ if (future.isCancelled()) {
+ rawFuture.cancel(true);
+ }
+ });
+ return future;
+ }
+
+ public CompletableFuture markNativeInvoicePaid(
+ String invoiceId, MarkInvoicePaidRequestBody request, RequestOptions requestOptions) {
+ CompletableFuture> rawFuture =
+ this.rawClient.markNativeInvoicePaid(invoiceId, request, requestOptions);
+ CompletableFuture future = rawFuture.thenApply(response -> response.body());
+ future.whenComplete((result_, throwable_) -> {
+ if (future.isCancelled()) {
+ rawFuture.cancel(true);
+ }
+ });
+ return future;
+ }
+
+ public CompletableFuture downloadNativeInvoicePdf(String invoiceId) {
+ CompletableFuture> rawFuture =
+ this.rawClient.downloadNativeInvoicePdf(invoiceId);
+ CompletableFuture future = rawFuture.thenApply(response -> response.body());
+ future.whenComplete((result_, throwable_) -> {
+ if (future.isCancelled()) {
+ rawFuture.cancel(true);
+ }
+ });
+ return future;
+ }
+
+ public CompletableFuture downloadNativeInvoicePdf(String invoiceId, RequestOptions requestOptions) {
+ CompletableFuture> rawFuture =
+ this.rawClient.downloadNativeInvoicePdf(invoiceId, requestOptions);
+ CompletableFuture future = rawFuture.thenApply(response -> response.body());
+ future.whenComplete((result_, throwable_) -> {
+ if (future.isCancelled()) {
+ rawFuture.cancel(true);
+ }
+ });
+ return future;
+ }
+
+ public CompletableFuture voidNativeInvoice(String invoiceId) {
+ CompletableFuture> rawFuture =
+ this.rawClient.voidNativeInvoice(invoiceId);
+ CompletableFuture future = rawFuture.thenApply(response -> response.body());
+ future.whenComplete((result_, throwable_) -> {
+ if (future.isCancelled()) {
+ rawFuture.cancel(true);
+ }
+ });
+ return future;
+ }
+
+ public CompletableFuture voidNativeInvoice(
+ String invoiceId, RequestOptions requestOptions) {
+ CompletableFuture> rawFuture =
+ this.rawClient.voidNativeInvoice(invoiceId, requestOptions);
+ CompletableFuture future = rawFuture.thenApply(response -> response.body());
+ future.whenComplete((result_, throwable_) -> {
+ if (future.isCancelled()) {
+ rawFuture.cancel(true);
+ }
+ });
+ return future;
+ }
+
+ public CompletableFuture countNativeInvoices() {
+ CompletableFuture> rawFuture =
+ this.rawClient.countNativeInvoices();
+ CompletableFuture future = rawFuture.thenApply(response -> response.body());
+ future.whenComplete((result_, throwable_) -> {
+ if (future.isCancelled()) {
+ rawFuture.cancel(true);
+ }
+ });
+ return future;
+ }
+
+ public CompletableFuture countNativeInvoices(RequestOptions requestOptions) {
+ CompletableFuture> rawFuture =
+ this.rawClient.countNativeInvoices(requestOptions);
+ CompletableFuture future = rawFuture.thenApply(response -> response.body());
+ future.whenComplete((result_, throwable_) -> {
+ if (future.isCancelled()) {
+ rawFuture.cancel(true);
+ }
+ });
+ return future;
+ }
+
+ public CompletableFuture countNativeInvoices(CountNativeInvoicesRequest request) {
+ CompletableFuture> rawFuture =
+ this.rawClient.countNativeInvoices(request);
+ CompletableFuture future = rawFuture.thenApply(response -> response.body());
+ future.whenComplete((result_, throwable_) -> {
+ if (future.isCancelled()) {
+ rawFuture.cancel(true);
+ }
+ });
+ return future;
+ }
+
+ public CompletableFuture countNativeInvoices(
+ CountNativeInvoicesRequest request, RequestOptions requestOptions) {
+ CompletableFuture> rawFuture =
+ this.rawClient.countNativeInvoices(request, requestOptions);
+ CompletableFuture future = rawFuture.thenApply(response -> response.body());
+ future.whenComplete((result_, throwable_) -> {
+ if (future.isCancelled()) {
+ rawFuture.cancel(true);
+ }
+ });
+ return future;
+ }
}
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 050f1539..b078b7ba 100644
--- a/src/main/java/com/schematic/api/resources/billing/AsyncRawBillingClient.java
+++ b/src/main/java/com/schematic/api/resources/billing/AsyncRawBillingClient.java
@@ -13,6 +13,7 @@
import com.schematic.api.core.ObjectMappers;
import com.schematic.api.core.QueryStringMapper;
import com.schematic.api.core.RequestOptions;
+import com.schematic.api.core.ResponseBodyInputStream;
import com.schematic.api.core.RetryInterceptor;
import com.schematic.api.errors.BadRequestError;
import com.schematic.api.errors.ForbiddenError;
@@ -21,6 +22,7 @@
import com.schematic.api.errors.UnauthorizedError;
import com.schematic.api.resources.billing.requests.CountBillingProductsRequest;
import com.schematic.api.resources.billing.requests.CountCustomersRequest;
+import com.schematic.api.resources.billing.requests.CountNativeInvoicesRequest;
import com.schematic.api.resources.billing.requests.CreateBillingCustomerRequestBody;
import com.schematic.api.resources.billing.requests.CreateBillingPriceRequestBody;
import com.schematic.api.resources.billing.requests.CreateBillingProductRequestBody;
@@ -37,18 +39,24 @@
import com.schematic.api.resources.billing.requests.ListCustomersWithSubscriptionsRequest;
import com.schematic.api.resources.billing.requests.ListInvoicesRequest;
import com.schematic.api.resources.billing.requests.ListMetersRequest;
+import com.schematic.api.resources.billing.requests.ListNativeInvoicesRequest;
import com.schematic.api.resources.billing.requests.ListPaymentMethodsRequest;
+import com.schematic.api.resources.billing.requests.MarkInvoicePaidRequestBody;
import com.schematic.api.resources.billing.requests.UpdateBillingSettingsRequestBody;
import com.schematic.api.resources.billing.requests.UpdateCompanyBillingProfileRequestBody;
import com.schematic.api.resources.billing.types.CountBillingProductsResponse;
import com.schematic.api.resources.billing.types.CountCustomersResponse;
+import com.schematic.api.resources.billing.types.CountNativeInvoicesResponse;
import com.schematic.api.resources.billing.types.DeleteBillingCouponResponse;
import com.schematic.api.resources.billing.types.DeleteBillingCustomerResponse;
import com.schematic.api.resources.billing.types.DeleteBillingInvoiceResponse;
import com.schematic.api.resources.billing.types.DeleteBillingProductResponse;
import com.schematic.api.resources.billing.types.DeletePaymentMethodByExternalIdResponse;
import com.schematic.api.resources.billing.types.DeleteProductPriceResponse;
+import com.schematic.api.resources.billing.types.FinalizeNativeInvoiceResponse;
import com.schematic.api.resources.billing.types.GetBillingSettingsResponse;
+import com.schematic.api.resources.billing.types.GetCompanyNativeSubscriptionResponse;
+import com.schematic.api.resources.billing.types.GetNativeInvoiceResponse;
import com.schematic.api.resources.billing.types.ListBillingPricesResponse;
import com.schematic.api.resources.billing.types.ListBillingProductPricesResponse;
import com.schematic.api.resources.billing.types.ListBillingProductsResponse;
@@ -57,7 +65,9 @@
import com.schematic.api.resources.billing.types.ListCustomersWithSubscriptionsResponse;
import com.schematic.api.resources.billing.types.ListInvoicesResponse;
import com.schematic.api.resources.billing.types.ListMetersResponse;
+import com.schematic.api.resources.billing.types.ListNativeInvoicesResponse;
import com.schematic.api.resources.billing.types.ListPaymentMethodsResponse;
+import com.schematic.api.resources.billing.types.MarkNativeInvoicePaidResponse;
import com.schematic.api.resources.billing.types.UpdateBillingSettingsResponse;
import com.schematic.api.resources.billing.types.UpdateCompanyBillingProfileResponse;
import com.schematic.api.resources.billing.types.UpsertBillingCouponResponse;
@@ -68,8 +78,10 @@
import com.schematic.api.resources.billing.types.UpsertBillingSubscriptionResponse;
import com.schematic.api.resources.billing.types.UpsertInvoiceResponse;
import com.schematic.api.resources.billing.types.UpsertPaymentMethodResponse;
+import com.schematic.api.resources.billing.types.VoidNativeInvoiceResponse;
import com.schematic.api.types.ApiError;
import java.io.IOException;
+import java.io.InputStream;
import java.util.concurrent.CompletableFuture;
import okhttp3.Call;
import okhttp3.Callback;
@@ -3604,4 +3616,1003 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) {
});
return future;
}
+
+ public CompletableFuture>
+ getCompanyNativeSubscription(String companyId) {
+ return getCompanyNativeSubscription(companyId, null);
+ }
+
+ public CompletableFuture>
+ getCompanyNativeSubscription(String companyId, RequestOptions requestOptions) {
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ .newBuilder()
+ .addPathSegments("companies")
+ .addPathSegment(companyId)
+ .addPathSegments("native-subscription");
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
+ Request okhttpRequest = new Request.Builder()
+ .url(httpUrl.build())
+ .method("GET", null)
+ .headers(Headers.of(clientOptions.headers(requestOptions)))
+ .addHeader("Accept", "application/json")
+ .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<>();
+ RetryInterceptor.AsyncCall okhttpCall = RetryInterceptor.newAsyncCall(client, okhttpRequest);
+ okhttpCall.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, GetCompanyNativeSubscriptionResponse.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));
+ }
+ });
+ future.whenComplete((result_, throwable_) -> {
+ if (future.isCancelled()) {
+ okhttpCall.cancel();
+ }
+ });
+ return future;
+ }
+
+ public CompletableFuture> listNativeInvoices() {
+ return listNativeInvoices(ListNativeInvoicesRequest.builder().build());
+ }
+
+ public CompletableFuture> listNativeInvoices(
+ RequestOptions requestOptions) {
+ return listNativeInvoices(ListNativeInvoicesRequest.builder().build(), requestOptions);
+ }
+
+ public CompletableFuture> listNativeInvoices(
+ ListNativeInvoicesRequest request) {
+ return listNativeInvoices(request, null);
+ }
+
+ public CompletableFuture> listNativeInvoices(
+ ListNativeInvoicesRequest request, RequestOptions requestOptions) {
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ .newBuilder()
+ .addPathSegments("invoices");
+ if (request.getCompanyId().isPresent()) {
+ QueryStringMapper.addQueryParameter(
+ httpUrl, "company_id", request.getCompanyId().get(), false);
+ }
+ if (request.getContractId().isPresent()) {
+ QueryStringMapper.addQueryParameter(
+ httpUrl, "contract_id", request.getContractId().get(), false);
+ }
+ if (request.getDocumentState().isPresent()) {
+ QueryStringMapper.addQueryParameter(
+ httpUrl, "document_state", request.getDocumentState().get(), false);
+ }
+ if (request.getLimit().isPresent()) {
+ QueryStringMapper.addQueryParameter(
+ httpUrl, "limit", request.getLimit().get(), false);
+ }
+ if (request.getOffset().isPresent()) {
+ QueryStringMapper.addQueryParameter(
+ httpUrl, "offset", request.getOffset().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<>();
+ RetryInterceptor.AsyncCall okhttpCall = RetryInterceptor.newAsyncCall(client, okhttpRequest);
+ okhttpCall.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, ListNativeInvoicesResponse.class),
+ response));
+ return;
+ }
+ try {
+ switch (response.code()) {
+ case 400:
+ future.completeExceptionally(new BadRequestError(
+ ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ApiError.class),
+ response));
+ return;
+ 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));
+ }
+ });
+ future.whenComplete((result_, throwable_) -> {
+ if (future.isCancelled()) {
+ okhttpCall.cancel();
+ }
+ });
+ return future;
+ }
+
+ public CompletableFuture> getNativeInvoice(String invoiceId) {
+ return getNativeInvoice(invoiceId, null);
+ }
+
+ public CompletableFuture> getNativeInvoice(
+ String invoiceId, RequestOptions requestOptions) {
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ .newBuilder()
+ .addPathSegments("invoices")
+ .addPathSegment(invoiceId);
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
+ Request okhttpRequest = new Request.Builder()
+ .url(httpUrl.build())
+ .method("GET", null)
+ .headers(Headers.of(clientOptions.headers(requestOptions)))
+ .addHeader("Accept", "application/json")
+ .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<>();
+ RetryInterceptor.AsyncCall okhttpCall = RetryInterceptor.newAsyncCall(client, okhttpRequest);
+ okhttpCall.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, GetNativeInvoiceResponse.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));
+ }
+ });
+ future.whenComplete((result_, throwable_) -> {
+ if (future.isCancelled()) {
+ okhttpCall.cancel();
+ }
+ });
+ return future;
+ }
+
+ public CompletableFuture> exportNativeInvoice(String invoiceId) {
+ return exportNativeInvoice(invoiceId, null);
+ }
+
+ public CompletableFuture> exportNativeInvoice(
+ String invoiceId, RequestOptions requestOptions) {
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ .newBuilder()
+ .addPathSegments("invoices")
+ .addPathSegment(invoiceId)
+ .addPathSegments("export");
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
+ Request okhttpRequest = new Request.Builder()
+ .url(httpUrl.build())
+ .method("GET", null)
+ .headers(Headers.of(clientOptions.headers(requestOptions)))
+ .addHeader("Accept", "application/json")
+ .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<>();
+ RetryInterceptor.AsyncCall okhttpCall = RetryInterceptor.newAsyncCall(client, okhttpRequest);
+ okhttpCall.enqueue(new Callback() {
+ @Override
+ public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException {
+ try {
+ ResponseBody responseBody = response.body();
+ if (response.isSuccessful()) {
+ future.complete(
+ new BaseSchematicHttpResponse<>(new ResponseBodyInputStream(response), response));
+ return;
+ }
+ String responseBodyString = responseBody != null ? responseBody.string() : "{}";
+ 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));
+ }
+ });
+ future.whenComplete((result_, throwable_) -> {
+ if (future.isCancelled()) {
+ okhttpCall.cancel();
+ }
+ });
+ return future;
+ }
+
+ public CompletableFuture> finalizeNativeInvoice(
+ String invoiceId) {
+ return finalizeNativeInvoice(invoiceId, null);
+ }
+
+ public CompletableFuture> finalizeNativeInvoice(
+ String invoiceId, RequestOptions requestOptions) {
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ .newBuilder()
+ .addPathSegments("invoices")
+ .addPathSegment(invoiceId)
+ .addPathSegments("finalize");
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
+ Request okhttpRequest = new Request.Builder()
+ .url(httpUrl.build())
+ .method(
+ "POST",
+ BodyProperties.toRequestBody(
+ requestOptions != null ? requestOptions.getBodyProperties() : null,
+ RequestBody.create("", null)))
+ .headers(Headers.of(clientOptions.headers(requestOptions)))
+ .addHeader("Accept", "application/json")
+ .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<>();
+ RetryInterceptor.AsyncCall okhttpCall = RetryInterceptor.newAsyncCall(client, okhttpRequest);
+ okhttpCall.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, FinalizeNativeInvoiceResponse.class),
+ response));
+ return;
+ }
+ try {
+ switch (response.code()) {
+ case 400:
+ future.completeExceptionally(new BadRequestError(
+ ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ApiError.class),
+ response));
+ return;
+ 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));
+ }
+ });
+ future.whenComplete((result_, throwable_) -> {
+ if (future.isCancelled()) {
+ okhttpCall.cancel();
+ }
+ });
+ return future;
+ }
+
+ public CompletableFuture> markNativeInvoicePaid(
+ String invoiceId, MarkInvoicePaidRequestBody request) {
+ return markNativeInvoicePaid(invoiceId, request, null);
+ }
+
+ public CompletableFuture> markNativeInvoicePaid(
+ String invoiceId, MarkInvoicePaidRequestBody request, RequestOptions requestOptions) {
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ .newBuilder()
+ .addPathSegments("invoices")
+ .addPathSegment(invoiceId)
+ .addPathSegments("mark-paid");
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
+ RequestBody body;
+ try {
+ body = RequestBody.create(
+ ObjectMappers.JSON_MAPPER.writeValueAsBytes(BodyProperties.merge(
+ request, requestOptions != null ? requestOptions.getBodyProperties() : null)),
+ MediaTypes.APPLICATION_JSON);
+ } catch (JsonProcessingException e) {
+ throw new BaseSchematicException("Failed to serialize request", e);
+ }
+ Request okhttpRequest = new Request.Builder()
+ .url(httpUrl.build())
+ .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()) {
+ 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<>();
+ RetryInterceptor.AsyncCall okhttpCall = RetryInterceptor.newAsyncCall(client, okhttpRequest);
+ okhttpCall.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, MarkNativeInvoicePaidResponse.class),
+ response));
+ return;
+ }
+ try {
+ switch (response.code()) {
+ case 400:
+ future.completeExceptionally(new BadRequestError(
+ ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ApiError.class),
+ response));
+ return;
+ 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));
+ }
+ });
+ future.whenComplete((result_, throwable_) -> {
+ if (future.isCancelled()) {
+ okhttpCall.cancel();
+ }
+ });
+ return future;
+ }
+
+ public CompletableFuture> downloadNativeInvoicePdf(String invoiceId) {
+ return downloadNativeInvoicePdf(invoiceId, null);
+ }
+
+ public CompletableFuture> downloadNativeInvoicePdf(
+ String invoiceId, RequestOptions requestOptions) {
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ .newBuilder()
+ .addPathSegments("invoices")
+ .addPathSegment(invoiceId)
+ .addPathSegments("pdf");
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
+ Request okhttpRequest = new Request.Builder()
+ .url(httpUrl.build())
+ .method("GET", null)
+ .headers(Headers.of(clientOptions.headers(requestOptions)))
+ .addHeader("Accept", "application/json")
+ .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<>();
+ RetryInterceptor.AsyncCall okhttpCall = RetryInterceptor.newAsyncCall(client, okhttpRequest);
+ okhttpCall.enqueue(new Callback() {
+ @Override
+ public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException {
+ try {
+ ResponseBody responseBody = response.body();
+ if (response.isSuccessful()) {
+ future.complete(
+ new BaseSchematicHttpResponse<>(new ResponseBodyInputStream(response), response));
+ return;
+ }
+ String responseBodyString = responseBody != null ? responseBody.string() : "{}";
+ 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));
+ }
+ });
+ future.whenComplete((result_, throwable_) -> {
+ if (future.isCancelled()) {
+ okhttpCall.cancel();
+ }
+ });
+ return future;
+ }
+
+ public CompletableFuture> voidNativeInvoice(String invoiceId) {
+ return voidNativeInvoice(invoiceId, null);
+ }
+
+ public CompletableFuture> voidNativeInvoice(
+ String invoiceId, RequestOptions requestOptions) {
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ .newBuilder()
+ .addPathSegments("invoices")
+ .addPathSegment(invoiceId)
+ .addPathSegments("void");
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
+ Request okhttpRequest = new Request.Builder()
+ .url(httpUrl.build())
+ .method(
+ "POST",
+ BodyProperties.toRequestBody(
+ requestOptions != null ? requestOptions.getBodyProperties() : null,
+ RequestBody.create("", null)))
+ .headers(Headers.of(clientOptions.headers(requestOptions)))
+ .addHeader("Accept", "application/json")
+ .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<>();
+ RetryInterceptor.AsyncCall okhttpCall = RetryInterceptor.newAsyncCall(client, okhttpRequest);
+ okhttpCall.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, VoidNativeInvoiceResponse.class),
+ response));
+ return;
+ }
+ try {
+ switch (response.code()) {
+ case 400:
+ future.completeExceptionally(new BadRequestError(
+ ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ApiError.class),
+ response));
+ return;
+ 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));
+ }
+ });
+ future.whenComplete((result_, throwable_) -> {
+ if (future.isCancelled()) {
+ okhttpCall.cancel();
+ }
+ });
+ return future;
+ }
+
+ public CompletableFuture> countNativeInvoices() {
+ return countNativeInvoices(CountNativeInvoicesRequest.builder().build());
+ }
+
+ public CompletableFuture> countNativeInvoices(
+ RequestOptions requestOptions) {
+ return countNativeInvoices(CountNativeInvoicesRequest.builder().build(), requestOptions);
+ }
+
+ public CompletableFuture> countNativeInvoices(
+ CountNativeInvoicesRequest request) {
+ return countNativeInvoices(request, null);
+ }
+
+ public CompletableFuture> countNativeInvoices(
+ CountNativeInvoicesRequest request, RequestOptions requestOptions) {
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ .newBuilder()
+ .addPathSegments("invoices/count");
+ if (request.getCompanyId().isPresent()) {
+ QueryStringMapper.addQueryParameter(
+ httpUrl, "company_id", request.getCompanyId().get(), false);
+ }
+ if (request.getContractId().isPresent()) {
+ QueryStringMapper.addQueryParameter(
+ httpUrl, "contract_id", request.getContractId().get(), false);
+ }
+ if (request.getDocumentState().isPresent()) {
+ QueryStringMapper.addQueryParameter(
+ httpUrl, "document_state", request.getDocumentState().get(), false);
+ }
+ if (request.getLimit().isPresent()) {
+ QueryStringMapper.addQueryParameter(
+ httpUrl, "limit", request.getLimit().get(), false);
+ }
+ if (request.getOffset().isPresent()) {
+ QueryStringMapper.addQueryParameter(
+ httpUrl, "offset", request.getOffset().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<>();
+ RetryInterceptor.AsyncCall okhttpCall = RetryInterceptor.newAsyncCall(client, okhttpRequest);
+ okhttpCall.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, CountNativeInvoicesResponse.class),
+ response));
+ return;
+ }
+ try {
+ switch (response.code()) {
+ case 400:
+ future.completeExceptionally(new BadRequestError(
+ ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ApiError.class),
+ response));
+ return;
+ 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));
+ }
+ });
+ future.whenComplete((result_, throwable_) -> {
+ if (future.isCancelled()) {
+ okhttpCall.cancel();
+ }
+ });
+ return future;
+ }
}
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 b88e95ee..68283035 100644
--- a/src/main/java/com/schematic/api/resources/billing/BillingClient.java
+++ b/src/main/java/com/schematic/api/resources/billing/BillingClient.java
@@ -7,6 +7,7 @@
import com.schematic.api.core.RequestOptions;
import com.schematic.api.resources.billing.requests.CountBillingProductsRequest;
import com.schematic.api.resources.billing.requests.CountCustomersRequest;
+import com.schematic.api.resources.billing.requests.CountNativeInvoicesRequest;
import com.schematic.api.resources.billing.requests.CreateBillingCustomerRequestBody;
import com.schematic.api.resources.billing.requests.CreateBillingPriceRequestBody;
import com.schematic.api.resources.billing.requests.CreateBillingProductRequestBody;
@@ -23,18 +24,24 @@
import com.schematic.api.resources.billing.requests.ListCustomersWithSubscriptionsRequest;
import com.schematic.api.resources.billing.requests.ListInvoicesRequest;
import com.schematic.api.resources.billing.requests.ListMetersRequest;
+import com.schematic.api.resources.billing.requests.ListNativeInvoicesRequest;
import com.schematic.api.resources.billing.requests.ListPaymentMethodsRequest;
+import com.schematic.api.resources.billing.requests.MarkInvoicePaidRequestBody;
import com.schematic.api.resources.billing.requests.UpdateBillingSettingsRequestBody;
import com.schematic.api.resources.billing.requests.UpdateCompanyBillingProfileRequestBody;
import com.schematic.api.resources.billing.types.CountBillingProductsResponse;
import com.schematic.api.resources.billing.types.CountCustomersResponse;
+import com.schematic.api.resources.billing.types.CountNativeInvoicesResponse;
import com.schematic.api.resources.billing.types.DeleteBillingCouponResponse;
import com.schematic.api.resources.billing.types.DeleteBillingCustomerResponse;
import com.schematic.api.resources.billing.types.DeleteBillingInvoiceResponse;
import com.schematic.api.resources.billing.types.DeleteBillingProductResponse;
import com.schematic.api.resources.billing.types.DeletePaymentMethodByExternalIdResponse;
import com.schematic.api.resources.billing.types.DeleteProductPriceResponse;
+import com.schematic.api.resources.billing.types.FinalizeNativeInvoiceResponse;
import com.schematic.api.resources.billing.types.GetBillingSettingsResponse;
+import com.schematic.api.resources.billing.types.GetCompanyNativeSubscriptionResponse;
+import com.schematic.api.resources.billing.types.GetNativeInvoiceResponse;
import com.schematic.api.resources.billing.types.ListBillingPricesResponse;
import com.schematic.api.resources.billing.types.ListBillingProductPricesResponse;
import com.schematic.api.resources.billing.types.ListBillingProductsResponse;
@@ -43,7 +50,9 @@
import com.schematic.api.resources.billing.types.ListCustomersWithSubscriptionsResponse;
import com.schematic.api.resources.billing.types.ListInvoicesResponse;
import com.schematic.api.resources.billing.types.ListMetersResponse;
+import com.schematic.api.resources.billing.types.ListNativeInvoicesResponse;
import com.schematic.api.resources.billing.types.ListPaymentMethodsResponse;
+import com.schematic.api.resources.billing.types.MarkNativeInvoicePaidResponse;
import com.schematic.api.resources.billing.types.UpdateBillingSettingsResponse;
import com.schematic.api.resources.billing.types.UpdateCompanyBillingProfileResponse;
import com.schematic.api.resources.billing.types.UpsertBillingCouponResponse;
@@ -54,6 +63,8 @@
import com.schematic.api.resources.billing.types.UpsertBillingSubscriptionResponse;
import com.schematic.api.resources.billing.types.UpsertInvoiceResponse;
import com.schematic.api.resources.billing.types.UpsertPaymentMethodResponse;
+import com.schematic.api.resources.billing.types.VoidNativeInvoiceResponse;
+import java.io.InputStream;
public class BillingClient {
protected final ClientOptions clientOptions;
@@ -404,4 +415,102 @@ public UpsertBillingSubscriptionResponse upsertBillingSubscription(
CreateBillingSubscriptionRequestBody request, RequestOptions requestOptions) {
return this.rawClient.upsertBillingSubscription(request, requestOptions).body();
}
+
+ public GetCompanyNativeSubscriptionResponse getCompanyNativeSubscription(String companyId) {
+ return this.rawClient.getCompanyNativeSubscription(companyId).body();
+ }
+
+ public GetCompanyNativeSubscriptionResponse getCompanyNativeSubscription(
+ String companyId, RequestOptions requestOptions) {
+ return this.rawClient
+ .getCompanyNativeSubscription(companyId, requestOptions)
+ .body();
+ }
+
+ public ListNativeInvoicesResponse listNativeInvoices() {
+ return this.rawClient.listNativeInvoices().body();
+ }
+
+ public ListNativeInvoicesResponse listNativeInvoices(RequestOptions requestOptions) {
+ return this.rawClient.listNativeInvoices(requestOptions).body();
+ }
+
+ public ListNativeInvoicesResponse listNativeInvoices(ListNativeInvoicesRequest request) {
+ return this.rawClient.listNativeInvoices(request).body();
+ }
+
+ public ListNativeInvoicesResponse listNativeInvoices(
+ ListNativeInvoicesRequest request, RequestOptions requestOptions) {
+ return this.rawClient.listNativeInvoices(request, requestOptions).body();
+ }
+
+ public GetNativeInvoiceResponse getNativeInvoice(String invoiceId) {
+ return this.rawClient.getNativeInvoice(invoiceId).body();
+ }
+
+ public GetNativeInvoiceResponse getNativeInvoice(String invoiceId, RequestOptions requestOptions) {
+ return this.rawClient.getNativeInvoice(invoiceId, requestOptions).body();
+ }
+
+ public InputStream exportNativeInvoice(String invoiceId) {
+ return this.rawClient.exportNativeInvoice(invoiceId).body();
+ }
+
+ public InputStream exportNativeInvoice(String invoiceId, RequestOptions requestOptions) {
+ return this.rawClient.exportNativeInvoice(invoiceId, requestOptions).body();
+ }
+
+ public FinalizeNativeInvoiceResponse finalizeNativeInvoice(String invoiceId) {
+ return this.rawClient.finalizeNativeInvoice(invoiceId).body();
+ }
+
+ public FinalizeNativeInvoiceResponse finalizeNativeInvoice(String invoiceId, RequestOptions requestOptions) {
+ return this.rawClient.finalizeNativeInvoice(invoiceId, requestOptions).body();
+ }
+
+ public MarkNativeInvoicePaidResponse markNativeInvoicePaid(String invoiceId, MarkInvoicePaidRequestBody request) {
+ return this.rawClient.markNativeInvoicePaid(invoiceId, request).body();
+ }
+
+ public MarkNativeInvoicePaidResponse markNativeInvoicePaid(
+ String invoiceId, MarkInvoicePaidRequestBody request, RequestOptions requestOptions) {
+ return this.rawClient
+ .markNativeInvoicePaid(invoiceId, request, requestOptions)
+ .body();
+ }
+
+ public InputStream downloadNativeInvoicePdf(String invoiceId) {
+ return this.rawClient.downloadNativeInvoicePdf(invoiceId).body();
+ }
+
+ public InputStream downloadNativeInvoicePdf(String invoiceId, RequestOptions requestOptions) {
+ return this.rawClient
+ .downloadNativeInvoicePdf(invoiceId, requestOptions)
+ .body();
+ }
+
+ public VoidNativeInvoiceResponse voidNativeInvoice(String invoiceId) {
+ return this.rawClient.voidNativeInvoice(invoiceId).body();
+ }
+
+ public VoidNativeInvoiceResponse voidNativeInvoice(String invoiceId, RequestOptions requestOptions) {
+ return this.rawClient.voidNativeInvoice(invoiceId, requestOptions).body();
+ }
+
+ public CountNativeInvoicesResponse countNativeInvoices() {
+ return this.rawClient.countNativeInvoices().body();
+ }
+
+ public CountNativeInvoicesResponse countNativeInvoices(RequestOptions requestOptions) {
+ return this.rawClient.countNativeInvoices(requestOptions).body();
+ }
+
+ public CountNativeInvoicesResponse countNativeInvoices(CountNativeInvoicesRequest request) {
+ return this.rawClient.countNativeInvoices(request).body();
+ }
+
+ public CountNativeInvoicesResponse countNativeInvoices(
+ CountNativeInvoicesRequest request, RequestOptions requestOptions) {
+ return this.rawClient.countNativeInvoices(request, requestOptions).body();
+ }
}
diff --git a/src/main/java/com/schematic/api/resources/billing/RawBillingClient.java b/src/main/java/com/schematic/api/resources/billing/RawBillingClient.java
index 0852504a..b672f12b 100644
--- a/src/main/java/com/schematic/api/resources/billing/RawBillingClient.java
+++ b/src/main/java/com/schematic/api/resources/billing/RawBillingClient.java
@@ -13,6 +13,7 @@
import com.schematic.api.core.ObjectMappers;
import com.schematic.api.core.QueryStringMapper;
import com.schematic.api.core.RequestOptions;
+import com.schematic.api.core.ResponseBodyInputStream;
import com.schematic.api.core.RetryInterceptor;
import com.schematic.api.errors.BadRequestError;
import com.schematic.api.errors.ForbiddenError;
@@ -21,6 +22,7 @@
import com.schematic.api.errors.UnauthorizedError;
import com.schematic.api.resources.billing.requests.CountBillingProductsRequest;
import com.schematic.api.resources.billing.requests.CountCustomersRequest;
+import com.schematic.api.resources.billing.requests.CountNativeInvoicesRequest;
import com.schematic.api.resources.billing.requests.CreateBillingCustomerRequestBody;
import com.schematic.api.resources.billing.requests.CreateBillingPriceRequestBody;
import com.schematic.api.resources.billing.requests.CreateBillingProductRequestBody;
@@ -37,18 +39,24 @@
import com.schematic.api.resources.billing.requests.ListCustomersWithSubscriptionsRequest;
import com.schematic.api.resources.billing.requests.ListInvoicesRequest;
import com.schematic.api.resources.billing.requests.ListMetersRequest;
+import com.schematic.api.resources.billing.requests.ListNativeInvoicesRequest;
import com.schematic.api.resources.billing.requests.ListPaymentMethodsRequest;
+import com.schematic.api.resources.billing.requests.MarkInvoicePaidRequestBody;
import com.schematic.api.resources.billing.requests.UpdateBillingSettingsRequestBody;
import com.schematic.api.resources.billing.requests.UpdateCompanyBillingProfileRequestBody;
import com.schematic.api.resources.billing.types.CountBillingProductsResponse;
import com.schematic.api.resources.billing.types.CountCustomersResponse;
+import com.schematic.api.resources.billing.types.CountNativeInvoicesResponse;
import com.schematic.api.resources.billing.types.DeleteBillingCouponResponse;
import com.schematic.api.resources.billing.types.DeleteBillingCustomerResponse;
import com.schematic.api.resources.billing.types.DeleteBillingInvoiceResponse;
import com.schematic.api.resources.billing.types.DeleteBillingProductResponse;
import com.schematic.api.resources.billing.types.DeletePaymentMethodByExternalIdResponse;
import com.schematic.api.resources.billing.types.DeleteProductPriceResponse;
+import com.schematic.api.resources.billing.types.FinalizeNativeInvoiceResponse;
import com.schematic.api.resources.billing.types.GetBillingSettingsResponse;
+import com.schematic.api.resources.billing.types.GetCompanyNativeSubscriptionResponse;
+import com.schematic.api.resources.billing.types.GetNativeInvoiceResponse;
import com.schematic.api.resources.billing.types.ListBillingPricesResponse;
import com.schematic.api.resources.billing.types.ListBillingProductPricesResponse;
import com.schematic.api.resources.billing.types.ListBillingProductsResponse;
@@ -57,7 +65,9 @@
import com.schematic.api.resources.billing.types.ListCustomersWithSubscriptionsResponse;
import com.schematic.api.resources.billing.types.ListInvoicesResponse;
import com.schematic.api.resources.billing.types.ListMetersResponse;
+import com.schematic.api.resources.billing.types.ListNativeInvoicesResponse;
import com.schematic.api.resources.billing.types.ListPaymentMethodsResponse;
+import com.schematic.api.resources.billing.types.MarkNativeInvoicePaidResponse;
import com.schematic.api.resources.billing.types.UpdateBillingSettingsResponse;
import com.schematic.api.resources.billing.types.UpdateCompanyBillingProfileResponse;
import com.schematic.api.resources.billing.types.UpsertBillingCouponResponse;
@@ -68,8 +78,10 @@
import com.schematic.api.resources.billing.types.UpsertBillingSubscriptionResponse;
import com.schematic.api.resources.billing.types.UpsertInvoiceResponse;
import com.schematic.api.resources.billing.types.UpsertPaymentMethodResponse;
+import com.schematic.api.resources.billing.types.VoidNativeInvoiceResponse;
import com.schematic.api.types.ApiError;
import java.io.IOException;
+import java.io.InputStream;
import okhttp3.Headers;
import okhttp3.HttpUrl;
import okhttp3.OkHttpClient;
@@ -2710,4 +2722,728 @@ public BaseSchematicHttpResponse upsertBillin
throw new BaseSchematicException("Network error executing HTTP request", e);
}
}
+
+ public BaseSchematicHttpResponse getCompanyNativeSubscription(
+ String companyId) {
+ return getCompanyNativeSubscription(companyId, null);
+ }
+
+ public BaseSchematicHttpResponse getCompanyNativeSubscription(
+ String companyId, RequestOptions requestOptions) {
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ .newBuilder()
+ .addPathSegments("companies")
+ .addPathSegment(companyId)
+ .addPathSegments("native-subscription");
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
+ Request okhttpRequest = new Request.Builder()
+ .url(httpUrl.build())
+ .method("GET", null)
+ .headers(Headers.of(clientOptions.headers(requestOptions)))
+ .addHeader("Accept", "application/json")
+ .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, GetCompanyNativeSubscriptionResponse.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 listNativeInvoices() {
+ return listNativeInvoices(ListNativeInvoicesRequest.builder().build());
+ }
+
+ public BaseSchematicHttpResponse listNativeInvoices(RequestOptions requestOptions) {
+ return listNativeInvoices(ListNativeInvoicesRequest.builder().build(), requestOptions);
+ }
+
+ public BaseSchematicHttpResponse listNativeInvoices(ListNativeInvoicesRequest request) {
+ return listNativeInvoices(request, null);
+ }
+
+ public BaseSchematicHttpResponse listNativeInvoices(
+ ListNativeInvoicesRequest request, RequestOptions requestOptions) {
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ .newBuilder()
+ .addPathSegments("invoices");
+ if (request.getCompanyId().isPresent()) {
+ QueryStringMapper.addQueryParameter(
+ httpUrl, "company_id", request.getCompanyId().get(), false);
+ }
+ if (request.getContractId().isPresent()) {
+ QueryStringMapper.addQueryParameter(
+ httpUrl, "contract_id", request.getContractId().get(), false);
+ }
+ if (request.getDocumentState().isPresent()) {
+ QueryStringMapper.addQueryParameter(
+ httpUrl, "document_state", request.getDocumentState().get(), false);
+ }
+ if (request.getLimit().isPresent()) {
+ QueryStringMapper.addQueryParameter(
+ httpUrl, "limit", request.getLimit().get(), false);
+ }
+ if (request.getOffset().isPresent()) {
+ QueryStringMapper.addQueryParameter(
+ httpUrl, "offset", request.getOffset().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, ListNativeInvoicesResponse.class),
+ response);
+ }
+ try {
+ switch (response.code()) {
+ case 400:
+ throw new BadRequestError(
+ ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ApiError.class), response);
+ 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 getNativeInvoice(String invoiceId) {
+ return getNativeInvoice(invoiceId, null);
+ }
+
+ public BaseSchematicHttpResponse getNativeInvoice(
+ String invoiceId, RequestOptions requestOptions) {
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ .newBuilder()
+ .addPathSegments("invoices")
+ .addPathSegment(invoiceId);
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
+ Request okhttpRequest = new Request.Builder()
+ .url(httpUrl.build())
+ .method("GET", null)
+ .headers(Headers.of(clientOptions.headers(requestOptions)))
+ .addHeader("Accept", "application/json")
+ .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, GetNativeInvoiceResponse.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 exportNativeInvoice(String invoiceId) {
+ return exportNativeInvoice(invoiceId, null);
+ }
+
+ public BaseSchematicHttpResponse exportNativeInvoice(String invoiceId, RequestOptions requestOptions) {
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ .newBuilder()
+ .addPathSegments("invoices")
+ .addPathSegment(invoiceId)
+ .addPathSegments("export");
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
+ Request okhttpRequest = new Request.Builder()
+ .url(httpUrl.build())
+ .method("GET", null)
+ .headers(Headers.of(clientOptions.headers(requestOptions)))
+ .addHeader("Accept", "application/json")
+ .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();
+ if (response.isSuccessful()) {
+ return new BaseSchematicHttpResponse<>(new ResponseBodyInputStream(response), response);
+ }
+ String responseBodyString = responseBody != null ? responseBody.string() : "{}";
+ 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 finalizeNativeInvoice(String invoiceId) {
+ return finalizeNativeInvoice(invoiceId, null);
+ }
+
+ public BaseSchematicHttpResponse finalizeNativeInvoice(
+ String invoiceId, RequestOptions requestOptions) {
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ .newBuilder()
+ .addPathSegments("invoices")
+ .addPathSegment(invoiceId)
+ .addPathSegments("finalize");
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
+ Request okhttpRequest = new Request.Builder()
+ .url(httpUrl.build())
+ .method(
+ "POST",
+ BodyProperties.toRequestBody(
+ requestOptions != null ? requestOptions.getBodyProperties() : null,
+ RequestBody.create("", null)))
+ .headers(Headers.of(clientOptions.headers(requestOptions)))
+ .addHeader("Accept", "application/json")
+ .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, FinalizeNativeInvoiceResponse.class),
+ response);
+ }
+ try {
+ switch (response.code()) {
+ case 400:
+ throw new BadRequestError(
+ ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ApiError.class), response);
+ 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 markNativeInvoicePaid(
+ String invoiceId, MarkInvoicePaidRequestBody request) {
+ return markNativeInvoicePaid(invoiceId, request, null);
+ }
+
+ public BaseSchematicHttpResponse markNativeInvoicePaid(
+ String invoiceId, MarkInvoicePaidRequestBody request, RequestOptions requestOptions) {
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ .newBuilder()
+ .addPathSegments("invoices")
+ .addPathSegment(invoiceId)
+ .addPathSegments("mark-paid");
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
+ RequestBody body;
+ try {
+ body = RequestBody.create(
+ ObjectMappers.JSON_MAPPER.writeValueAsBytes(BodyProperties.merge(
+ request, requestOptions != null ? requestOptions.getBodyProperties() : null)),
+ MediaTypes.APPLICATION_JSON);
+ } catch (JsonProcessingException e) {
+ throw new BaseSchematicException("Failed to serialize request", e);
+ }
+ Request okhttpRequest = new Request.Builder()
+ .url(httpUrl.build())
+ .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()) {
+ 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, MarkNativeInvoicePaidResponse.class),
+ response);
+ }
+ try {
+ switch (response.code()) {
+ case 400:
+ throw new BadRequestError(
+ ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ApiError.class), response);
+ 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 downloadNativeInvoicePdf(String invoiceId) {
+ return downloadNativeInvoicePdf(invoiceId, null);
+ }
+
+ public BaseSchematicHttpResponse downloadNativeInvoicePdf(
+ String invoiceId, RequestOptions requestOptions) {
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ .newBuilder()
+ .addPathSegments("invoices")
+ .addPathSegment(invoiceId)
+ .addPathSegments("pdf");
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
+ Request okhttpRequest = new Request.Builder()
+ .url(httpUrl.build())
+ .method("GET", null)
+ .headers(Headers.of(clientOptions.headers(requestOptions)))
+ .addHeader("Accept", "application/json")
+ .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();
+ if (response.isSuccessful()) {
+ return new BaseSchematicHttpResponse<>(new ResponseBodyInputStream(response), response);
+ }
+ String responseBodyString = responseBody != null ? responseBody.string() : "{}";
+ 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 voidNativeInvoice(String invoiceId) {
+ return voidNativeInvoice(invoiceId, null);
+ }
+
+ public BaseSchematicHttpResponse voidNativeInvoice(
+ String invoiceId, RequestOptions requestOptions) {
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ .newBuilder()
+ .addPathSegments("invoices")
+ .addPathSegment(invoiceId)
+ .addPathSegments("void");
+ if (requestOptions != null) {
+ requestOptions.getQueryParameters().forEach((_key, _value) -> {
+ httpUrl.addQueryParameter(_key, _value);
+ });
+ }
+ Request okhttpRequest = new Request.Builder()
+ .url(httpUrl.build())
+ .method(
+ "POST",
+ BodyProperties.toRequestBody(
+ requestOptions != null ? requestOptions.getBodyProperties() : null,
+ RequestBody.create("", null)))
+ .headers(Headers.of(clientOptions.headers(requestOptions)))
+ .addHeader("Accept", "application/json")
+ .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, VoidNativeInvoiceResponse.class),
+ response);
+ }
+ try {
+ switch (response.code()) {
+ case 400:
+ throw new BadRequestError(
+ ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ApiError.class), response);
+ 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 countNativeInvoices() {
+ return countNativeInvoices(CountNativeInvoicesRequest.builder().build());
+ }
+
+ public BaseSchematicHttpResponse countNativeInvoices(RequestOptions requestOptions) {
+ return countNativeInvoices(CountNativeInvoicesRequest.builder().build(), requestOptions);
+ }
+
+ public BaseSchematicHttpResponse countNativeInvoices(
+ CountNativeInvoicesRequest request) {
+ return countNativeInvoices(request, null);
+ }
+
+ public BaseSchematicHttpResponse countNativeInvoices(
+ CountNativeInvoicesRequest request, RequestOptions requestOptions) {
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ .newBuilder()
+ .addPathSegments("invoices/count");
+ if (request.getCompanyId().isPresent()) {
+ QueryStringMapper.addQueryParameter(
+ httpUrl, "company_id", request.getCompanyId().get(), false);
+ }
+ if (request.getContractId().isPresent()) {
+ QueryStringMapper.addQueryParameter(
+ httpUrl, "contract_id", request.getContractId().get(), false);
+ }
+ if (request.getDocumentState().isPresent()) {
+ QueryStringMapper.addQueryParameter(
+ httpUrl, "document_state", request.getDocumentState().get(), false);
+ }
+ if (request.getLimit().isPresent()) {
+ QueryStringMapper.addQueryParameter(
+ httpUrl, "limit", request.getLimit().get(), false);
+ }
+ if (request.getOffset().isPresent()) {
+ QueryStringMapper.addQueryParameter(
+ httpUrl, "offset", request.getOffset().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, CountNativeInvoicesResponse.class),
+ response);
+ }
+ try {
+ switch (response.code()) {
+ case 400:
+ throw new BadRequestError(
+ ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ApiError.class), response);
+ 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/billing/requests/CountBillingProductsRequest.java b/src/main/java/com/schematic/api/resources/billing/requests/CountBillingProductsRequest.java
index 7f9a73ea..0c94de88 100644
--- a/src/main/java/com/schematic/api/resources/billing/requests/CountBillingProductsRequest.java
+++ b/src/main/java/com/schematic/api/resources/billing/requests/CountBillingProductsRequest.java
@@ -254,7 +254,6 @@ public static final class Builder {
private Optional offset = Optional.empty();
- @JsonAnySetter
private Map additionalProperties = new HashMap<>();
private Builder() {}
@@ -466,6 +465,26 @@ public CountBillingProductsRequest build() {
additionalProperties);
}
+ @JsonAnySetter
+ private void putAdditionalPropertyFromJson(String key, Object value) {
+ if (key.equalsIgnoreCase("ids")
+ || key.equalsIgnoreCase("is_active")
+ || key.equalsIgnoreCase("name")
+ || key.equalsIgnoreCase("price_usage_type")
+ || key.equalsIgnoreCase("provider_type")
+ || key.equalsIgnoreCase("q")
+ || key.equalsIgnoreCase("recurring_charges_only")
+ || key.equalsIgnoreCase("with_one_time_charges")
+ || key.equalsIgnoreCase("with_prices_only")
+ || key.equalsIgnoreCase("with_zero_price")
+ || key.equalsIgnoreCase("without_linked_to_plan")
+ || key.equalsIgnoreCase("limit")
+ || key.equalsIgnoreCase("offset")) {
+ return;
+ }
+ this.additionalProperties.put(key, value);
+ }
+
public Builder additionalProperty(String key, Object value) {
this.additionalProperties.put(key, value);
return this;
diff --git a/src/main/java/com/schematic/api/resources/billing/requests/CountCustomersRequest.java b/src/main/java/com/schematic/api/resources/billing/requests/CountCustomersRequest.java
index 7b102837..6b092444 100644
--- a/src/main/java/com/schematic/api/resources/billing/requests/CountCustomersRequest.java
+++ b/src/main/java/com/schematic/api/resources/billing/requests/CountCustomersRequest.java
@@ -138,7 +138,6 @@ public static final class Builder {
private Optional offset = Optional.empty();
- @JsonAnySetter
private Map additionalProperties = new HashMap<>();
private Builder() {}
@@ -234,6 +233,19 @@ public CountCustomersRequest build() {
return new CountCustomersRequest(companyIds, name, providerType, q, limit, offset, additionalProperties);
}
+ @JsonAnySetter
+ private void putAdditionalPropertyFromJson(String key, Object value) {
+ if (key.equalsIgnoreCase("company_ids")
+ || key.equalsIgnoreCase("name")
+ || key.equalsIgnoreCase("provider_type")
+ || key.equalsIgnoreCase("q")
+ || key.equalsIgnoreCase("limit")
+ || key.equalsIgnoreCase("offset")) {
+ return;
+ }
+ this.additionalProperties.put(key, value);
+ }
+
public Builder additionalProperty(String key, Object value) {
this.additionalProperties.put(key, value);
return this;
diff --git a/src/main/java/com/schematic/api/resources/billing/requests/CountNativeInvoicesRequest.java b/src/main/java/com/schematic/api/resources/billing/requests/CountNativeInvoicesRequest.java
new file mode 100644
index 00000000..e5c19eee
--- /dev/null
+++ b/src/main/java/com/schematic/api/resources/billing/requests/CountNativeInvoicesRequest.java
@@ -0,0 +1,228 @@
+/**
+ * This file was auto-generated by Fern from our API Definition.
+ */
+package com.schematic.api.resources.billing.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 com.schematic.api.types.InvoiceDocumentState;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Optional;
+
+@JsonInclude(JsonInclude.Include.NON_ABSENT)
+@JsonDeserialize(builder = CountNativeInvoicesRequest.Builder.class)
+public final class CountNativeInvoicesRequest {
+ private final Optional companyId;
+
+ private final Optional contractId;
+
+ private final Optional documentState;
+
+ private final Optional limit;
+
+ private final Optional offset;
+
+ private final Map additionalProperties;
+
+ private CountNativeInvoicesRequest(
+ Optional companyId,
+ Optional contractId,
+ Optional documentState,
+ Optional limit,
+ Optional offset,
+ Map additionalProperties) {
+ this.companyId = companyId;
+ this.contractId = contractId;
+ this.documentState = documentState;
+ this.limit = limit;
+ this.offset = offset;
+ this.additionalProperties = additionalProperties;
+ }
+
+ @JsonProperty("company_id")
+ public Optional getCompanyId() {
+ return companyId;
+ }
+
+ @JsonProperty("contract_id")
+ public Optional getContractId() {
+ return contractId;
+ }
+
+ @JsonProperty("document_state")
+ public Optional getDocumentState() {
+ return documentState;
+ }
+
+ /**
+ * @return Page limit (default 100)
+ */
+ @JsonProperty("limit")
+ public Optional getLimit() {
+ return limit;
+ }
+
+ /**
+ * @return Page offset (default 0)
+ */
+ @JsonProperty("offset")
+ public Optional getOffset() {
+ return offset;
+ }
+
+ @java.lang.Override
+ public boolean equals(Object other) {
+ if (this == other) return true;
+ return other instanceof CountNativeInvoicesRequest && equalTo((CountNativeInvoicesRequest) other);
+ }
+
+ @JsonAnyGetter
+ public Map getAdditionalProperties() {
+ return this.additionalProperties;
+ }
+
+ private boolean equalTo(CountNativeInvoicesRequest other) {
+ return companyId.equals(other.companyId)
+ && contractId.equals(other.contractId)
+ && documentState.equals(other.documentState)
+ && limit.equals(other.limit)
+ && offset.equals(other.offset);
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ return Objects.hash(this.companyId, this.contractId, this.documentState, this.limit, this.offset);
+ }
+
+ @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 contractId = Optional.empty();
+
+ private Optional documentState = Optional.empty();
+
+ private Optional limit = Optional.empty();
+
+ private Optional offset = Optional.empty();
+
+ private Map additionalProperties = new HashMap<>();
+
+ private Builder() {}
+
+ public Builder from(CountNativeInvoicesRequest other) {
+ companyId(other.getCompanyId());
+ contractId(other.getContractId());
+ documentState(other.getDocumentState());
+ limit(other.getLimit());
+ offset(other.getOffset());
+ return this;
+ }
+
+ @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;
+ }
+
+ @JsonSetter(value = "contract_id", nulls = Nulls.SKIP)
+ public Builder contractId(Optional contractId) {
+ this.contractId = contractId;
+ return this;
+ }
+
+ public Builder contractId(String contractId) {
+ this.contractId = Optional.ofNullable(contractId);
+ return this;
+ }
+
+ @JsonSetter(value = "document_state", nulls = Nulls.SKIP)
+ public Builder documentState(Optional documentState) {
+ this.documentState = documentState;
+ return this;
+ }
+
+ public Builder documentState(InvoiceDocumentState documentState) {
+ this.documentState = Optional.ofNullable(documentState);
+ return this;
+ }
+
+ /**
+ * Page limit (default 100)
+ */
+ @JsonSetter(value = "limit", nulls = Nulls.SKIP)
+ public Builder limit(Optional limit) {
+ this.limit = limit;
+ return this;
+ }
+
+ public Builder limit(Long limit) {
+ this.limit = Optional.ofNullable(limit);
+ return this;
+ }
+
+ /**
+ * Page offset (default 0)
+ */
+ @JsonSetter(value = "offset", nulls = Nulls.SKIP)
+ public Builder offset(Optional offset) {
+ this.offset = offset;
+ return this;
+ }
+
+ public Builder offset(Long offset) {
+ this.offset = Optional.ofNullable(offset);
+ return this;
+ }
+
+ public CountNativeInvoicesRequest build() {
+ return new CountNativeInvoicesRequest(
+ companyId, contractId, documentState, limit, offset, additionalProperties);
+ }
+
+ @JsonAnySetter
+ private void putAdditionalPropertyFromJson(String key, Object value) {
+ if (key.equalsIgnoreCase("company_id")
+ || key.equalsIgnoreCase("contract_id")
+ || key.equalsIgnoreCase("document_state")
+ || key.equalsIgnoreCase("limit")
+ || key.equalsIgnoreCase("offset")) {
+ return;
+ }
+ this.additionalProperties.put(key, value);
+ }
+
+ 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/billing/requests/CreateBillingCustomerRequestBody.java b/src/main/java/com/schematic/api/resources/billing/requests/CreateBillingCustomerRequestBody.java
index 33421b1a..e59ec521 100644
--- a/src/main/java/com/schematic/api/resources/billing/requests/CreateBillingCustomerRequestBody.java
+++ b/src/main/java/com/schematic/api/resources/billing/requests/CreateBillingCustomerRequestBody.java
@@ -191,7 +191,6 @@ public static final class Builder implements EmailStage, ExternalIdStage, NameSt
private Optional companyId = Optional.empty();
- @JsonAnySetter
private Map additionalProperties = new HashMap<>();
private Builder() {}
@@ -305,6 +304,20 @@ public CreateBillingCustomerRequestBody build() {
additionalProperties);
}
+ @JsonAnySetter
+ private void putAdditionalPropertyFromJson(String key, Object value) {
+ if (key.equalsIgnoreCase("company_id")
+ || key.equalsIgnoreCase("default_payment_method_id")
+ || key.equalsIgnoreCase("email")
+ || key.equalsIgnoreCase("external_id")
+ || key.equalsIgnoreCase("meta")
+ || key.equalsIgnoreCase("name")
+ || key.equalsIgnoreCase("provider_type")) {
+ return;
+ }
+ this.additionalProperties.put(key, value);
+ }
+
@java.lang.Override
public Builder additionalProperty(String key, Object value) {
this.additionalProperties.put(key, value);
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 7453a670..a5a95738 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
@@ -377,7 +377,6 @@ public static final class Builder
private Optional intervalCount = Optional.empty();
- @JsonAnySetter
private Map additionalProperties = new HashMap<>();
private Builder() {}
@@ -605,6 +604,30 @@ public CreateBillingPriceRequestBody build() {
additionalProperties);
}
+ @JsonAnySetter
+ private void putAdditionalPropertyFromJson(String key, Object value) {
+ if (key.equalsIgnoreCase("billing_scheme")
+ || key.equalsIgnoreCase("currency")
+ || key.equalsIgnoreCase("external_account_id")
+ || key.equalsIgnoreCase("interval")
+ || key.equalsIgnoreCase("interval_count")
+ || key.equalsIgnoreCase("is_active")
+ || key.equalsIgnoreCase("meter_id")
+ || key.equalsIgnoreCase("nickname")
+ || key.equalsIgnoreCase("package_size")
+ || key.equalsIgnoreCase("price")
+ || key.equalsIgnoreCase("price_decimal")
+ || key.equalsIgnoreCase("price_external_id")
+ || key.equalsIgnoreCase("price_tiers")
+ || key.equalsIgnoreCase("product_external_id")
+ || key.equalsIgnoreCase("provider_type")
+ || key.equalsIgnoreCase("tiers_mode")
+ || key.equalsIgnoreCase("usage_type")) {
+ return;
+ }
+ this.additionalProperties.put(key, value);
+ }
+
@java.lang.Override
public Builder additionalProperty(String key, Object value) {
this.additionalProperties.put(key, value);
diff --git a/src/main/java/com/schematic/api/resources/billing/requests/CreateBillingProductRequestBody.java b/src/main/java/com/schematic/api/resources/billing/requests/CreateBillingProductRequestBody.java
index e437951f..20e4a91f 100644
--- a/src/main/java/com/schematic/api/resources/billing/requests/CreateBillingProductRequestBody.java
+++ b/src/main/java/com/schematic/api/resources/billing/requests/CreateBillingProductRequestBody.java
@@ -149,7 +149,6 @@ public static final class Builder implements ExternalIdStage, PriceStage, _Final
private Optional isActive = Optional.empty();
- @JsonAnySetter
private Map additionalProperties = new HashMap<>();
private Builder() {}
@@ -223,6 +222,18 @@ public CreateBillingProductRequestBody build() {
externalId, isActive, name, price, providerType, additionalProperties);
}
+ @JsonAnySetter
+ private void putAdditionalPropertyFromJson(String key, Object value) {
+ if (key.equalsIgnoreCase("external_id")
+ || key.equalsIgnoreCase("is_active")
+ || key.equalsIgnoreCase("name")
+ || key.equalsIgnoreCase("price")
+ || key.equalsIgnoreCase("provider_type")) {
+ return;
+ }
+ this.additionalProperties.put(key, value);
+ }
+
@java.lang.Override
public Builder additionalProperty(String key, Object value) {
this.additionalProperties.put(key, value);
diff --git a/src/main/java/com/schematic/api/resources/billing/requests/CreateBillingSubscriptionRequestBody.java b/src/main/java/com/schematic/api/resources/billing/requests/CreateBillingSubscriptionRequestBody.java
index c36dfac3..3fe274c6 100644
--- a/src/main/java/com/schematic/api/resources/billing/requests/CreateBillingSubscriptionRequestBody.java
+++ b/src/main/java/com/schematic/api/resources/billing/requests/CreateBillingSubscriptionRequestBody.java
@@ -463,7 +463,6 @@ public static final class Builder
private Optional applicationId = Optional.empty();
- @JsonAnySetter
private Map additionalProperties = new HashMap<>();
private Builder() {}
@@ -796,6 +795,35 @@ public CreateBillingSubscriptionRequestBody build() {
additionalProperties);
}
+ @JsonAnySetter
+ private void putAdditionalPropertyFromJson(String key, Object value) {
+ if (key.equalsIgnoreCase("application_id")
+ || key.equalsIgnoreCase("cancel_at")
+ || key.equalsIgnoreCase("cancel_at_period_end")
+ || key.equalsIgnoreCase("company_id")
+ || key.equalsIgnoreCase("currency")
+ || key.equalsIgnoreCase("customer_external_id")
+ || key.equalsIgnoreCase("default_payment_method_external_id")
+ || key.equalsIgnoreCase("default_payment_method_id")
+ || key.equalsIgnoreCase("discounts")
+ || key.equalsIgnoreCase("expired_at")
+ || key.equalsIgnoreCase("interval")
+ || key.equalsIgnoreCase("metadata")
+ || key.equalsIgnoreCase("period_end")
+ || key.equalsIgnoreCase("period_start")
+ || key.equalsIgnoreCase("product_external_ids")
+ || key.equalsIgnoreCase("provider_type")
+ || key.equalsIgnoreCase("started_at")
+ || key.equalsIgnoreCase("status")
+ || key.equalsIgnoreCase("subscription_external_id")
+ || key.equalsIgnoreCase("total_price")
+ || key.equalsIgnoreCase("trial_end")
+ || key.equalsIgnoreCase("trial_end_setting")) {
+ return;
+ }
+ this.additionalProperties.put(key, value);
+ }
+
@java.lang.Override
public Builder additionalProperty(String key, Object value) {
this.additionalProperties.put(key, value);
diff --git a/src/main/java/com/schematic/api/resources/billing/requests/CreateCouponRequestBody.java b/src/main/java/com/schematic/api/resources/billing/requests/CreateCouponRequestBody.java
index 5f2e65b9..df89b38d 100644
--- a/src/main/java/com/schematic/api/resources/billing/requests/CreateCouponRequestBody.java
+++ b/src/main/java/com/schematic/api/resources/billing/requests/CreateCouponRequestBody.java
@@ -231,7 +231,6 @@ public static final class Builder
private Optional currency = Optional.empty();
- @JsonAnySetter
private Map additionalProperties = new HashMap<>();
private Builder() {}
@@ -334,6 +333,22 @@ public CreateCouponRequestBody build() {
additionalProperties);
}
+ @JsonAnySetter
+ private void putAdditionalPropertyFromJson(String key, Object value) {
+ if (key.equalsIgnoreCase("amount_off")
+ || key.equalsIgnoreCase("currency")
+ || key.equalsIgnoreCase("duration")
+ || key.equalsIgnoreCase("duration_in_months")
+ || key.equalsIgnoreCase("external_id")
+ || key.equalsIgnoreCase("max_redemptions")
+ || key.equalsIgnoreCase("name")
+ || key.equalsIgnoreCase("percent_off")
+ || key.equalsIgnoreCase("times_redeemed")) {
+ return;
+ }
+ this.additionalProperties.put(key, value);
+ }
+
@java.lang.Override
public Builder additionalProperty(String key, Object value) {
this.additionalProperties.put(key, value);
diff --git a/src/main/java/com/schematic/api/resources/billing/requests/CreateInvoiceRequestBody.java b/src/main/java/com/schematic/api/resources/billing/requests/CreateInvoiceRequestBody.java
index 1f3ec3e4..b0a4a9f7 100644
--- a/src/main/java/com/schematic/api/resources/billing/requests/CreateInvoiceRequestBody.java
+++ b/src/main/java/com/schematic/api/resources/billing/requests/CreateInvoiceRequestBody.java
@@ -351,7 +351,6 @@ public static final class Builder
private Optional dueDate = Optional.empty();
- @JsonAnySetter
private Map additionalProperties = new HashMap<>();
private Builder() {}
@@ -565,6 +564,29 @@ public CreateInvoiceRequestBody build() {
additionalProperties);
}
+ @JsonAnySetter
+ private void putAdditionalPropertyFromJson(String key, Object value) {
+ if (key.equalsIgnoreCase("amount_due")
+ || key.equalsIgnoreCase("amount_paid")
+ || key.equalsIgnoreCase("amount_remaining")
+ || key.equalsIgnoreCase("collection_method")
+ || key.equalsIgnoreCase("currency")
+ || key.equalsIgnoreCase("customer_external_id")
+ || key.equalsIgnoreCase("due_date")
+ || key.equalsIgnoreCase("ending_balance")
+ || key.equalsIgnoreCase("external_id")
+ || key.equalsIgnoreCase("payment_method_external_id")
+ || key.equalsIgnoreCase("starting_balance")
+ || key.equalsIgnoreCase("status")
+ || key.equalsIgnoreCase("subscription_external_id")
+ || key.equalsIgnoreCase("subtotal")
+ || key.equalsIgnoreCase("total")
+ || key.equalsIgnoreCase("url")) {
+ return;
+ }
+ this.additionalProperties.put(key, value);
+ }
+
@java.lang.Override
public Builder additionalProperty(String key, Object value) {
this.additionalProperties.put(key, value);
diff --git a/src/main/java/com/schematic/api/resources/billing/requests/CreateMeterRequestBody.java b/src/main/java/com/schematic/api/resources/billing/requests/CreateMeterRequestBody.java
index a2db149c..b9977ffe 100644
--- a/src/main/java/com/schematic/api/resources/billing/requests/CreateMeterRequestBody.java
+++ b/src/main/java/com/schematic/api/resources/billing/requests/CreateMeterRequestBody.java
@@ -150,7 +150,6 @@ public static final class Builder
private Optional providerType = Optional.empty();
- @JsonAnySetter
private Map additionalProperties = new HashMap<>();
private Builder() {}
@@ -212,6 +211,18 @@ public CreateMeterRequestBody build() {
displayName, eventName, eventPayloadKey, externalId, providerType, additionalProperties);
}
+ @JsonAnySetter
+ private void putAdditionalPropertyFromJson(String key, Object value) {
+ if (key.equalsIgnoreCase("display_name")
+ || key.equalsIgnoreCase("event_name")
+ || key.equalsIgnoreCase("event_payload_key")
+ || key.equalsIgnoreCase("external_id")
+ || key.equalsIgnoreCase("provider_type")) {
+ return;
+ }
+ this.additionalProperties.put(key, value);
+ }
+
@java.lang.Override
public Builder additionalProperty(String key, Object value) {
this.additionalProperties.put(key, value);
diff --git a/src/main/java/com/schematic/api/resources/billing/requests/CreatePaymentMethodRequestBody.java b/src/main/java/com/schematic/api/resources/billing/requests/CreatePaymentMethodRequestBody.java
index 542fd346..de1d09cb 100644
--- a/src/main/java/com/schematic/api/resources/billing/requests/CreatePaymentMethodRequestBody.java
+++ b/src/main/java/com/schematic/api/resources/billing/requests/CreatePaymentMethodRequestBody.java
@@ -273,7 +273,6 @@ public static final class Builder
private Optional accountLast4 = Optional.empty();
- @JsonAnySetter
private Map additionalProperties = new HashMap<>();
private Builder() {}
@@ -451,6 +450,25 @@ public CreatePaymentMethodRequestBody build() {
additionalProperties);
}
+ @JsonAnySetter
+ private void putAdditionalPropertyFromJson(String key, Object value) {
+ if (key.equalsIgnoreCase("account_last4")
+ || key.equalsIgnoreCase("account_name")
+ || key.equalsIgnoreCase("bank_name")
+ || key.equalsIgnoreCase("billing_email")
+ || key.equalsIgnoreCase("billing_name")
+ || key.equalsIgnoreCase("card_brand")
+ || key.equalsIgnoreCase("card_exp_month")
+ || key.equalsIgnoreCase("card_exp_year")
+ || key.equalsIgnoreCase("card_last4")
+ || key.equalsIgnoreCase("customer_external_id")
+ || key.equalsIgnoreCase("external_id")
+ || key.equalsIgnoreCase("payment_method_type")) {
+ return;
+ }
+ this.additionalProperties.put(key, value);
+ }
+
@java.lang.Override
public Builder additionalProperty(String key, Object value) {
this.additionalProperties.put(key, value);
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 6f8481df..b1832c62 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
@@ -324,7 +324,6 @@ public static final class Builder {
private Optional