From 615af6c95e316a697178304a63f1da5f98eae7af Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
<41898282+github-actions[bot]@users.noreply.github.com>
Date: Fri, 9 Oct 2026 08:13:14 +0000
Subject: [PATCH] feat(api)!: update SDKs to meteroid 0.1.0
BEGIN_NESTED_COMMIT
feat(api)!: `POST /api/v1/events/ingest`: the `events/items/timestamp` request property `type/format` changed from `string` to `string, null/date-time`
END_NESTED_COMMIT
BEGIN_NESTED_COMMIT
feat(api): add `DELETE /api/v1/webhooks/endpoints/{endpoint_id}`
END_NESTED_COMMIT
BEGIN_NESTED_COMMIT
feat(api): update `GET /api/v1/plans` and 1029 more
END_NESTED_COMMIT
---
api.md | 25 +-
src/main/java/com/meteroid/Meteroid.java | 21 +
src/main/java/com/meteroid/MeteroidAsync.java | 21 +
.../com/meteroid/api/WebhookEndpoints.java | 136 ++++
.../meteroid/api/WebhookEndpointsAsync.java | 116 +++
.../api/WebhookEndpointsEndpoints.java | 705 +++++++++++++++++
.../api/WebhookEndpointsEndpointsAsync.java | 563 ++++++++++++++
...ointsEndpointsListDeliveriesAsyncPage.java | 71 ++
...dpointsEndpointsListDeliveriesOptions.java | 161 ++++
...kEndpointsEndpointsListDeliveriesPage.java | 73 ++
.../models/CreateWebhookEndpointRequest.java | 352 +++++++++
.../models/CreatedWebhookEndpoint.java | 227 ++++++
.../models/CustomerCreateRequest.java | 14 +-
src/main/java/com/meteroid/models/Event.java | 20 +-
src/main/java/com/meteroid/models/Plan.java | 8 +-
.../meteroid/models/PlanVersionSummary.java | 8 +-
.../models/UpdateWebhookEndpointRequest.java | 392 ++++++++++
.../com/meteroid/models/WebhookDelivery.java | 549 ++++++++++++++
.../models/WebhookDeliveryListResponse.java | 245 ++++++
.../models/WebhookDeliveryStatus.java | 157 ++++
.../com/meteroid/models/WebhookEndpoint.java | 708 ++++++++++++++++++
.../models/WebhookEndpointDisabledReason.java | 142 ++++
.../models/WebhookEndpointListResponse.java | 215 ++++++
.../models/WebhookEndpointSecret.java | 199 +++++
.../com/meteroid/models/WebhookHeader.java | 296 ++++++++
.../meteroid/models/WebhookHeaderInput.java | 265 +++++++
.../java/com/meteroid/api/CustomersTest.java | 2 +-
.../java/com/meteroid/api/EventsTest.java | 2 +-
src/test/java/com/meteroid/api/PlansTest.java | 12 +-
.../com/meteroid/api/PlansVersionsTest.java | 2 +-
.../api/WebhookEndpointsEndpointsTest.java | 102 +++
.../meteroid/api/WebhookEndpointsTest.java | 22 +
32 files changed, 5796 insertions(+), 35 deletions(-)
create mode 100644 src/main/java/com/meteroid/api/WebhookEndpoints.java
create mode 100644 src/main/java/com/meteroid/api/WebhookEndpointsAsync.java
create mode 100644 src/main/java/com/meteroid/api/WebhookEndpointsEndpoints.java
create mode 100644 src/main/java/com/meteroid/api/WebhookEndpointsEndpointsAsync.java
create mode 100644 src/main/java/com/meteroid/api/WebhookEndpointsEndpointsListDeliveriesAsyncPage.java
create mode 100644 src/main/java/com/meteroid/api/WebhookEndpointsEndpointsListDeliveriesOptions.java
create mode 100644 src/main/java/com/meteroid/api/WebhookEndpointsEndpointsListDeliveriesPage.java
create mode 100644 src/main/java/com/meteroid/models/CreateWebhookEndpointRequest.java
create mode 100644 src/main/java/com/meteroid/models/CreatedWebhookEndpoint.java
create mode 100644 src/main/java/com/meteroid/models/UpdateWebhookEndpointRequest.java
create mode 100644 src/main/java/com/meteroid/models/WebhookDelivery.java
create mode 100644 src/main/java/com/meteroid/models/WebhookDeliveryListResponse.java
create mode 100644 src/main/java/com/meteroid/models/WebhookDeliveryStatus.java
create mode 100644 src/main/java/com/meteroid/models/WebhookEndpoint.java
create mode 100644 src/main/java/com/meteroid/models/WebhookEndpointDisabledReason.java
create mode 100644 src/main/java/com/meteroid/models/WebhookEndpointListResponse.java
create mode 100644 src/main/java/com/meteroid/models/WebhookEndpointSecret.java
create mode 100644 src/main/java/com/meteroid/models/WebhookHeader.java
create mode 100644 src/main/java/com/meteroid/models/WebhookHeaderInput.java
create mode 100644 src/test/java/com/meteroid/api/WebhookEndpointsEndpointsTest.java
create mode 100644 src/test/java/com/meteroid/api/WebhookEndpointsTest.java
diff --git a/api.md b/api.md
index c7649db..1494c41 100644
--- a/api.md
+++ b/api.md
@@ -14,7 +14,7 @@ item from that page on, and `pages()` every page, fetching the next ones on dema
the response body as received. The async client's pages have `nextPage()`, `forEach(...)`,
`forEachPage(...)` and `toList()`, returning `CompletableFuture`s.
-[Add ons](#add-ons) · [Add ons entitlements](#add-ons-entitlements) · [Batch jobs](#batch-jobs) · [Checkout sessions](#checkout-sessions) · [Connect](#connect) · [Coupons](#coupons) · [Credit notes](#credit-notes) · [Custom properties](#custom-properties) · [Customers](#customers) · [Entitlements](#entitlements) · [Events](#events) · [Features](#features) · [Invoices](#invoices) · [Metrics](#metrics) · [Oauth](#oauth) · [Oauth apps](#oauth-apps) · [Plans](#plans) · [Plans versions](#plans-versions) · [Product families](#product-families) · [Products](#products) · [Products entitlements](#products-entitlements) · [Subscriptions](#subscriptions) · [Usage](#usage)
+[Add ons](#add-ons) · [Add ons entitlements](#add-ons-entitlements) · [Batch jobs](#batch-jobs) · [Checkout sessions](#checkout-sessions) · [Connect](#connect) · [Coupons](#coupons) · [Credit notes](#credit-notes) · [Custom properties](#custom-properties) · [Customers](#customers) · [Entitlements](#entitlements) · [Events](#events) · [Features](#features) · [Invoices](#invoices) · [Metrics](#metrics) · [Oauth](#oauth) · [Oauth apps](#oauth-apps) · [Plans](#plans) · [Plans versions](#plans-versions) · [Product families](#product-families) · [Products](#products) · [Products entitlements](#products-entitlements) · [Subscriptions](#subscriptions) · [Usage](#usage) · [Webhook endpoints](#webhook-endpoints) · [Webhook endpoints endpoints](#webhook-endpoints-endpoints)
## Add ons
@@ -287,3 +287,26 @@ the response body as received. The async client's pages have `nextPage()`, `forE
| `UsageResponse client.usage().retrieveCustomer(String customerId, LocalDate startDate, LocalDate endDate, [UsageRetrieveCustomerOptions options])` | `GET /api/v1/usage/customer/{customer_id}` | [`UsageResponse`](src/main/java/com/meteroid/models/UsageResponse.java) |
| `UsageResponse client.usage().retrieveSubscription(String subscriptionId, [UsageRetrieveSubscriptionOptions options])` | `GET /api/v1/usage/subscription/{subscription_id}` | [`UsageResponse`](src/main/java/com/meteroid/models/UsageResponse.java) |
| `UsageResponse client.usage().retrieveSummary(LocalDate startDate, LocalDate endDate, [UsageRetrieveSummaryOptions options])` | `GET /api/v1/usage/summary` | [`UsageResponse`](src/main/java/com/meteroid/models/UsageResponse.java) |
+
+## Webhook endpoints
+
+[`client.webhookEndpoints()`](src/main/java/com/meteroid/api/WebhookEndpoints.java)
+
+| Method | Request | Returns |
+| --- | --- | --- |
+| `WebhookDelivery client.webhookEndpoints().resendWebhookDelivery(String deliveryId)` | `POST /api/v1/webhooks/deliveries/{delivery_id}/resend` | [`WebhookDelivery`](src/main/java/com/meteroid/models/WebhookDelivery.java) |
+
+### Webhook endpoints endpoints
+
+[`client.webhookEndpoints().endpoints()`](src/main/java/com/meteroid/api/WebhookEndpointsEndpoints.java)
+
+| Method | Request | Returns |
+| --- | --- | --- |
+| `WebhookEndpointListResponse client.webhookEndpoints().endpoints().list()` | `GET /api/v1/webhooks/endpoints` | [`WebhookEndpointListResponse`](src/main/java/com/meteroid/models/WebhookEndpointListResponse.java) |
+| `CreatedWebhookEndpoint client.webhookEndpoints().endpoints().create(CreateWebhookEndpointRequest createWebhookEndpointRequest)` | `POST /api/v1/webhooks/endpoints` | [`CreatedWebhookEndpoint`](src/main/java/com/meteroid/models/CreatedWebhookEndpoint.java) |
+| `WebhookEndpoint client.webhookEndpoints().endpoints().retrieve(String endpointId)` | `GET /api/v1/webhooks/endpoints/{endpoint_id}` | [`WebhookEndpoint`](src/main/java/com/meteroid/models/WebhookEndpoint.java) |
+| `void client.webhookEndpoints().endpoints().delete(String endpointId)` | `DELETE /api/v1/webhooks/endpoints/{endpoint_id}` | nothing |
+| `WebhookEndpoint client.webhookEndpoints().endpoints().update(String endpointId, UpdateWebhookEndpointRequest updateWebhookEndpointRequest)` | `PATCH /api/v1/webhooks/endpoints/{endpoint_id}` | [`WebhookEndpoint`](src/main/java/com/meteroid/models/WebhookEndpoint.java) |
+| `WebhookEndpointsEndpointsListDeliveriesPage client.webhookEndpoints().endpoints().listDeliveries(String endpointId, [WebhookEndpointsEndpointsListDeliveriesOptions options])` | `GET /api/v1/webhooks/endpoints/{endpoint_id}/deliveries` | [page](src/main/java/com/meteroid/api/WebhookEndpointsEndpointsListDeliveriesPage.java) of [`WebhookDelivery`](src/main/java/com/meteroid/models/WebhookDelivery.java), with the properties of [`WebhookDeliveryListResponse`](src/main/java/com/meteroid/models/WebhookDeliveryListResponse.java) |
+| `WebhookEndpointSecret client.webhookEndpoints().endpoints().rotateSecret(String endpointId)` | `POST /api/v1/webhooks/endpoints/{endpoint_id}/rotate-secret` | [`WebhookEndpointSecret`](src/main/java/com/meteroid/models/WebhookEndpointSecret.java) |
+| `WebhookEndpointSecret client.webhookEndpoints().endpoints().retrieveSecret(String endpointId)` | `GET /api/v1/webhooks/endpoints/{endpoint_id}/secret` | [`WebhookEndpointSecret`](src/main/java/com/meteroid/models/WebhookEndpointSecret.java) |
diff --git a/src/main/java/com/meteroid/Meteroid.java b/src/main/java/com/meteroid/Meteroid.java
index 2f06564..02ab491 100644
--- a/src/main/java/com/meteroid/Meteroid.java
+++ b/src/main/java/com/meteroid/Meteroid.java
@@ -21,6 +21,7 @@
import com.meteroid.api.Products;
import com.meteroid.api.Subscriptions;
import com.meteroid.api.Usage;
+import com.meteroid.api.WebhookEndpoints;
import com.meteroid.internal.MeteroidAuth;
import com.meteroid.internal.MeteroidHttpClient;
@@ -75,6 +76,7 @@ public final class Meteroid implements AutoCloseable {
private final Products products;
private final Subscriptions subscriptions;
private final Usage usage;
+ private final WebhookEndpoints webhookEndpoints;
/**
* A client with the default options, its API key and base URL read from the environment.
@@ -147,6 +149,7 @@ public Meteroid(MeteroidOptions options) {
this.products = new Products(httpClient);
this.subscriptions = new Subscriptions(httpClient);
this.usage = new Usage(httpClient);
+ this.webhookEndpoints = new WebhookEndpoints(httpClient);
this.withRawResponse = new WithRawResponse();
this.async = new MeteroidAsync(this);
}
@@ -372,6 +375,15 @@ public Usage usage() {
return usage;
}
+ /**
+ * The {@code webhook_endpoints} operations.
+ *
+ * @return the operations
+ */
+ public WebhookEndpoints webhookEndpoints() {
+ return webhookEndpoints;
+ }
+
/** The operations, returning the status and headers along with the body. */
public final class WithRawResponse {
private WithRawResponse() {}
@@ -555,5 +567,14 @@ public Subscriptions.WithRawResponse subscriptions() {
public Usage.WithRawResponse usage() {
return usage.withRawResponse();
}
+
+ /**
+ * The {@code webhook_endpoints} operations.
+ *
+ * @return the operations
+ */
+ public WebhookEndpoints.WithRawResponse webhookEndpoints() {
+ return webhookEndpoints.withRawResponse();
+ }
}
}
diff --git a/src/main/java/com/meteroid/MeteroidAsync.java b/src/main/java/com/meteroid/MeteroidAsync.java
index f87dc06..664ea14 100644
--- a/src/main/java/com/meteroid/MeteroidAsync.java
+++ b/src/main/java/com/meteroid/MeteroidAsync.java
@@ -21,6 +21,7 @@
import com.meteroid.api.ProductsAsync;
import com.meteroid.api.SubscriptionsAsync;
import com.meteroid.api.UsageAsync;
+import com.meteroid.api.WebhookEndpointsAsync;
/**
* The Meteroid client without blocking: every method returns a {@link
@@ -50,6 +51,7 @@ public final class MeteroidAsync implements AutoCloseable {
private final ProductsAsync products;
private final SubscriptionsAsync subscriptions;
private final UsageAsync usage;
+ private final WebhookEndpointsAsync webhookEndpoints;
MeteroidAsync(Meteroid sync) {
this.sync = sync;
@@ -73,6 +75,7 @@ public final class MeteroidAsync implements AutoCloseable {
this.products = new ProductsAsync(sync.products());
this.subscriptions = new SubscriptionsAsync(sync.subscriptions());
this.usage = new UsageAsync(sync.usage());
+ this.webhookEndpoints = new WebhookEndpointsAsync(sync.webhookEndpoints());
this.withRawResponse = new WithRawResponse();
}
@@ -274,6 +277,15 @@ public UsageAsync usage() {
return usage;
}
+ /**
+ * The {@code webhook_endpoints} operations.
+ *
+ * @return the operations
+ */
+ public WebhookEndpointsAsync webhookEndpoints() {
+ return webhookEndpoints;
+ }
+
/** Closes the client shared with {@link #sync()}. */
@Override
public void close() {
@@ -463,5 +475,14 @@ public SubscriptionsAsync.WithRawResponse subscriptions() {
public UsageAsync.WithRawResponse usage() {
return usage.withRawResponse();
}
+
+ /**
+ * The {@code webhook_endpoints} operations.
+ *
+ * @return the operations
+ */
+ public WebhookEndpointsAsync.WithRawResponse webhookEndpoints() {
+ return webhookEndpoints.withRawResponse();
+ }
}
}
diff --git a/src/main/java/com/meteroid/api/WebhookEndpoints.java b/src/main/java/com/meteroid/api/WebhookEndpoints.java
new file mode 100644
index 0000000..c0edd36
--- /dev/null
+++ b/src/main/java/com/meteroid/api/WebhookEndpoints.java
@@ -0,0 +1,136 @@
+// this file is @generated
+package com.meteroid.api;
+
+import com.meteroid.ApiResponse;
+import com.meteroid.RequestOptions;
+import com.meteroid.internal.MeteroidHttpClient;
+import com.meteroid.internal.Utils;
+import com.meteroid.models.WebhookDelivery;
+
+import okhttp3.HttpUrl;
+
+import java.util.Objects;
+
+/**
+ * The {@code webhook_endpoints} operations, blocking. {@link #withRawResponse()} has the same
+ * methods returning the status and headers along with the body.
+ */
+public final class WebhookEndpoints {
+ private final MeteroidHttpClient client;
+ private final WithRawResponse withRawResponse;
+
+ private final WebhookEndpointsEndpoints endpoints;
+
+ /**
+ * The operations, sending through {@code client}.
+ *
+ * @param client the HTTP client of the SDK
+ */
+ public WebhookEndpoints(MeteroidHttpClient client) {
+ this.client = client;
+ this.withRawResponse = new WithRawResponse();
+
+ this.endpoints = new WebhookEndpointsEndpoints(client);
+ }
+
+ /**
+ * The same operations, returning the status and headers along with the body.
+ *
+ * @return the operations
+ */
+ public WithRawResponse withRawResponse() {
+ return withRawResponse;
+ }
+
+ /**
+ * The {@code endpoints} operations.
+ *
+ * @return the operations
+ */
+ public WebhookEndpointsEndpoints endpoints() {
+ return endpoints;
+ }
+
+ /**
+ * Resend a webhook delivery
+ *
+ *
Re-queues the same event for the same endpoint. Fails if the endpoint is disabled.
+ *
+ * @param deliveryId the {@code delivery_id} path parameter
+ * @return the response body
+ */
+ public WebhookDelivery resendWebhookDelivery(final String deliveryId) {
+ return resendWebhookDelivery(deliveryId, RequestOptions.none());
+ }
+
+ /**
+ * Resend a webhook delivery
+ *
+ *
Re-queues the same event for the same endpoint. Fails if the endpoint is disabled.
+ *
+ * @param deliveryId the {@code delivery_id} path parameter
+ * @param requestOptions headers, timeout and retries of this call
+ * @return the response body
+ */
+ public WebhookDelivery resendWebhookDelivery(
+ final String deliveryId, final RequestOptions requestOptions) {
+ return exchangeResendWebhookDelivery(deliveryId, requestOptions).send();
+ }
+
+ MeteroidHttpClient.Exchange exchangeResendWebhookDelivery(
+ final String deliveryId, final RequestOptions requestOptions) {
+ Objects.requireNonNull(deliveryId, "delivery_id");
+ HttpUrl url =
+ client.newUrlBuilder()
+ .addPathSegments("api/v1/webhooks/deliveries")
+ .addPathSegment(Utils.pathSegment("delivery_id", deliveryId))
+ .addPathSegments("resend")
+ .build();
+ return client.call("POST", url)
+ .errors(com.meteroid.models.RestErrorResponse.class, "400", "401", "404", "429")
+ .options(requestOptions)
+ .returning(WebhookDelivery.class);
+ }
+
+ /** The operations, returning the status and headers along with the body. */
+ public final class WithRawResponse {
+ private WithRawResponse() {}
+
+ /**
+ * The {@code endpoints} operations.
+ *
+ * @return the operations
+ */
+ public WebhookEndpointsEndpoints.WithRawResponse endpoints() {
+ return WebhookEndpoints.this.endpoints.withRawResponse();
+ }
+
+ /**
+ * Resend a webhook delivery
+ *
+ *
Re-queues the same event for the same endpoint. Fails if the endpoint is disabled.
+ *
+ * @param deliveryId the {@code delivery_id} path parameter
+ * @return the status, headers and body
+ */
+ public ApiResponse resendWebhookDelivery(final String deliveryId) {
+ return resendWebhookDelivery(deliveryId, RequestOptions.none());
+ }
+
+ /**
+ * Resend a webhook delivery
+ *
+ *
Re-queues the same event for the same endpoint. Fails if the endpoint is disabled.
+ *
+ * @param deliveryId the {@code delivery_id} path parameter
+ * @param requestOptions headers, timeout and retries of this call
+ * @return the status, headers and body
+ */
+ public ApiResponse resendWebhookDelivery(
+ final String deliveryId, final RequestOptions requestOptions) {
+ return WebhookEndpoints.this
+ .exchangeResendWebhookDelivery(deliveryId, requestOptions)
+ .sendRaw();
+ }
+ }
+}
diff --git a/src/main/java/com/meteroid/api/WebhookEndpointsAsync.java b/src/main/java/com/meteroid/api/WebhookEndpointsAsync.java
new file mode 100644
index 0000000..8428e27
--- /dev/null
+++ b/src/main/java/com/meteroid/api/WebhookEndpointsAsync.java
@@ -0,0 +1,116 @@
+// this file is @generated
+package com.meteroid.api;
+
+import com.meteroid.ApiResponse;
+import com.meteroid.RequestOptions;
+import com.meteroid.models.WebhookDelivery;
+
+import java.util.concurrent.CompletableFuture;
+
+/**
+ * The {@code webhook_endpoints} operations, without blocking: each method returns a {@link
+ * CompletableFuture}. Obtained from {@code client.async()}.
+ */
+public final class WebhookEndpointsAsync {
+ private final WebhookEndpoints sync;
+ private final WithRawResponse withRawResponse;
+
+ private final WebhookEndpointsEndpointsAsync endpoints;
+
+ /**
+ * The operations, sending through {@code sync}.
+ *
+ * @param sync the blocking operations
+ */
+ public WebhookEndpointsAsync(WebhookEndpoints sync) {
+ this.sync = sync;
+ this.withRawResponse = new WithRawResponse();
+
+ this.endpoints = new WebhookEndpointsEndpointsAsync(sync.endpoints());
+ }
+
+ /**
+ * The same operations, returning the status and headers along with the body.
+ *
+ * @return the operations
+ */
+ public WithRawResponse withRawResponse() {
+ return withRawResponse;
+ }
+
+ /**
+ * The {@code endpoints} operations.
+ *
+ * @return the operations
+ */
+ public WebhookEndpointsEndpointsAsync endpoints() {
+ return endpoints;
+ }
+
+ /**
+ * Resend a webhook delivery
+ *
+ *
Re-queues the same event for the same endpoint. Fails if the endpoint is disabled.
+ *
+ * @param deliveryId the {@code delivery_id} path parameter
+ * @return the response body, once received
+ */
+ public CompletableFuture resendWebhookDelivery(final String deliveryId) {
+ return resendWebhookDelivery(deliveryId, RequestOptions.none());
+ }
+
+ /**
+ * Resend a webhook delivery
+ *
+ *
Re-queues the same event for the same endpoint. Fails if the endpoint is disabled.
+ *
+ * @param deliveryId the {@code delivery_id} path parameter
+ * @param requestOptions headers, timeout and retries of this call
+ * @return the response body, once received
+ */
+ public CompletableFuture resendWebhookDelivery(
+ final String deliveryId, final RequestOptions requestOptions) {
+ return sync.exchangeResendWebhookDelivery(deliveryId, requestOptions).sendAsync();
+ }
+
+ /** The operations, returning the status and headers along with the body. */
+ public final class WithRawResponse {
+ private WithRawResponse() {}
+
+ /**
+ * The {@code endpoints} operations.
+ *
+ * @return the operations
+ */
+ public WebhookEndpointsEndpointsAsync.WithRawResponse endpoints() {
+ return WebhookEndpointsAsync.this.endpoints.withRawResponse();
+ }
+
+ /**
+ * Resend a webhook delivery
+ *
+ *
Re-queues the same event for the same endpoint. Fails if the endpoint is disabled.
+ *
+ * @param deliveryId the {@code delivery_id} path parameter
+ * @return the status, headers and body, once received
+ */
+ public CompletableFuture> resendWebhookDelivery(
+ final String deliveryId) {
+ return resendWebhookDelivery(deliveryId, RequestOptions.none());
+ }
+
+ /**
+ * Resend a webhook delivery
+ *
+ *
Re-queues the same event for the same endpoint. Fails if the endpoint is disabled.
+ *
+ * @param deliveryId the {@code delivery_id} path parameter
+ * @param requestOptions headers, timeout and retries of this call
+ * @return the status, headers and body, once received
+ */
+ public CompletableFuture> resendWebhookDelivery(
+ final String deliveryId, final RequestOptions requestOptions) {
+ return sync.exchangeResendWebhookDelivery(deliveryId, requestOptions).sendRawAsync();
+ }
+ }
+}
diff --git a/src/main/java/com/meteroid/api/WebhookEndpointsEndpoints.java b/src/main/java/com/meteroid/api/WebhookEndpointsEndpoints.java
new file mode 100644
index 0000000..4a33a18
--- /dev/null
+++ b/src/main/java/com/meteroid/api/WebhookEndpointsEndpoints.java
@@ -0,0 +1,705 @@
+// this file is @generated
+package com.meteroid.api;
+
+import com.meteroid.ApiResponse;
+import com.meteroid.RequestOptions;
+import com.meteroid.internal.MeteroidHttpClient;
+import com.meteroid.internal.Utils;
+import com.meteroid.models.CreateWebhookEndpointRequest;
+import com.meteroid.models.CreatedWebhookEndpoint;
+import com.meteroid.models.UpdateWebhookEndpointRequest;
+import com.meteroid.models.WebhookDelivery;
+import com.meteroid.models.WebhookDeliveryListResponse;
+import com.meteroid.models.WebhookDeliveryStatus;
+import com.meteroid.models.WebhookEndpoint;
+import com.meteroid.models.WebhookEndpointListResponse;
+import com.meteroid.models.WebhookEndpointSecret;
+
+import okhttp3.HttpUrl;
+
+import java.util.List;
+import java.util.Objects;
+
+/**
+ * The {@code webhook_endpoints.endpoints} operations, blocking. {@link #withRawResponse()} has the
+ * same methods returning the status and headers along with the body.
+ */
+public final class WebhookEndpointsEndpoints {
+ private final MeteroidHttpClient client;
+ private final WithRawResponse withRawResponse;
+
+ /**
+ * The operations, sending through {@code client}.
+ *
+ * @param client the HTTP client of the SDK
+ */
+ public WebhookEndpointsEndpoints(MeteroidHttpClient client) {
+ this.client = client;
+ this.withRawResponse = new WithRawResponse();
+ }
+
+ /**
+ * The same operations, returning the status and headers along with the body.
+ *
+ * @return the operations
+ */
+ public WithRawResponse withRawResponse() {
+ return withRawResponse;
+ }
+
+ /**
+ * List webhook endpoints
+ *
+ * @return the response body
+ */
+ public WebhookEndpointListResponse list() {
+ return list(RequestOptions.none());
+ }
+
+ /**
+ * List webhook endpoints
+ *
+ * @param requestOptions headers, timeout and retries of this call
+ * @return the response body
+ */
+ public WebhookEndpointListResponse list(final RequestOptions requestOptions) {
+ return exchangeList(requestOptions).send();
+ }
+
+ MeteroidHttpClient.Exchange exchangeList(
+ final RequestOptions requestOptions) {
+ HttpUrl url = client.newUrlBuilder().addPathSegments("api/v1/webhooks/endpoints").build();
+ return client.call("GET", url)
+ .errors(com.meteroid.models.RestErrorResponse.class, "401", "429")
+ .options(requestOptions)
+ .returning(WebhookEndpointListResponse.class);
+ }
+
+ /**
+ * Create a webhook endpoint
+ *
+ *
The signing secret is returned once, in this response only.
+ *
+ * @param createWebhookEndpointRequest the request body
+ * @return the response body
+ */
+ public CreatedWebhookEndpoint create(
+ final CreateWebhookEndpointRequest createWebhookEndpointRequest) {
+ return create(createWebhookEndpointRequest, RequestOptions.none());
+ }
+
+ /**
+ * Create a webhook endpoint
+ *
+ *
The signing secret is returned once, in this response only.
+ *
+ * @param createWebhookEndpointRequest the request body
+ * @param requestOptions headers, timeout and retries of this call
+ * @return the response body
+ */
+ public CreatedWebhookEndpoint create(
+ final CreateWebhookEndpointRequest createWebhookEndpointRequest,
+ final RequestOptions requestOptions) {
+ return exchangeCreate(createWebhookEndpointRequest, requestOptions).send();
+ }
+
+ MeteroidHttpClient.Exchange exchangeCreate(
+ final CreateWebhookEndpointRequest createWebhookEndpointRequest,
+ final RequestOptions requestOptions) {
+ Objects.requireNonNull(createWebhookEndpointRequest, "body");
+ HttpUrl url = client.newUrlBuilder().addPathSegments("api/v1/webhooks/endpoints").build();
+ return client.call("POST", url)
+ .json(createWebhookEndpointRequest)
+ .errors(com.meteroid.models.RestErrorResponse.class, "400", "401", "409", "429")
+ .options(requestOptions)
+ .returning(CreatedWebhookEndpoint.class);
+ }
+
+ /**
+ * Get a webhook endpoint
+ *
+ * @param endpointId the {@code endpoint_id} path parameter
+ * @return the response body
+ */
+ public WebhookEndpoint retrieve(final String endpointId) {
+ return retrieve(endpointId, RequestOptions.none());
+ }
+
+ /**
+ * Get a webhook endpoint
+ *
+ * @param endpointId the {@code endpoint_id} path parameter
+ * @param requestOptions headers, timeout and retries of this call
+ * @return the response body
+ */
+ public WebhookEndpoint retrieve(final String endpointId, final RequestOptions requestOptions) {
+ return exchangeRetrieve(endpointId, requestOptions).send();
+ }
+
+ MeteroidHttpClient.Exchange exchangeRetrieve(
+ final String endpointId, final RequestOptions requestOptions) {
+ Objects.requireNonNull(endpointId, "endpoint_id");
+ HttpUrl url =
+ client.newUrlBuilder()
+ .addPathSegments("api/v1/webhooks/endpoints")
+ .addPathSegment(Utils.pathSegment("endpoint_id", endpointId))
+ .build();
+ return client.call("GET", url)
+ .errors(com.meteroid.models.RestErrorResponse.class, "401", "404", "429")
+ .options(requestOptions)
+ .returning(WebhookEndpoint.class);
+ }
+
+ /**
+ * Delete a webhook endpoint
+ *
+ *
The endpoint is archived and its pending deliveries are cancelled.
+ *
+ * @param endpointId the {@code endpoint_id} path parameter
+ */
+ public void delete(final String endpointId) {
+ delete(endpointId, RequestOptions.none());
+ }
+
+ /**
+ * Delete a webhook endpoint
+ *
+ *
The endpoint is archived and its pending deliveries are cancelled.
+ *
+ * @param endpointId the {@code endpoint_id} path parameter
+ * @param requestOptions headers, timeout and retries of this call
+ */
+ public void delete(final String endpointId, final RequestOptions requestOptions) {
+ exchangeDelete(endpointId, requestOptions).send();
+ }
+
+ MeteroidHttpClient.Exchange exchangeDelete(
+ final String endpointId, final RequestOptions requestOptions) {
+ Objects.requireNonNull(endpointId, "endpoint_id");
+ HttpUrl url =
+ client.newUrlBuilder()
+ .addPathSegments("api/v1/webhooks/endpoints")
+ .addPathSegment(Utils.pathSegment("endpoint_id", endpointId))
+ .build();
+ return client.call("DELETE", url)
+ .errors(com.meteroid.models.RestErrorResponse.class, "401", "404", "429")
+ .options(requestOptions)
+ .returningNothing();
+ }
+
+ /**
+ * Update a webhook endpoint
+ *
+ *
Omitted fields are left untouched. Re-enabling a disabled endpoint resets its consecutive
+ * failure count.
+ *
+ * @param endpointId the {@code endpoint_id} path parameter
+ * @param updateWebhookEndpointRequest the request body
+ * @return the response body
+ */
+ public WebhookEndpoint update(
+ final String endpointId,
+ final UpdateWebhookEndpointRequest updateWebhookEndpointRequest) {
+ return update(endpointId, updateWebhookEndpointRequest, RequestOptions.none());
+ }
+
+ /**
+ * Update a webhook endpoint
+ *
+ *
Omitted fields are left untouched. Re-enabling a disabled endpoint resets its consecutive
+ * failure count.
+ *
+ * @param endpointId the {@code endpoint_id} path parameter
+ * @param updateWebhookEndpointRequest the request body
+ * @param requestOptions headers, timeout and retries of this call
+ * @return the response body
+ */
+ public WebhookEndpoint update(
+ final String endpointId,
+ final UpdateWebhookEndpointRequest updateWebhookEndpointRequest,
+ final RequestOptions requestOptions) {
+ return exchangeUpdate(endpointId, updateWebhookEndpointRequest, requestOptions).send();
+ }
+
+ MeteroidHttpClient.Exchange exchangeUpdate(
+ final String endpointId,
+ final UpdateWebhookEndpointRequest updateWebhookEndpointRequest,
+ final RequestOptions requestOptions) {
+ Objects.requireNonNull(endpointId, "endpoint_id");
+ Objects.requireNonNull(updateWebhookEndpointRequest, "body");
+ HttpUrl url =
+ client.newUrlBuilder()
+ .addPathSegments("api/v1/webhooks/endpoints")
+ .addPathSegment(Utils.pathSegment("endpoint_id", endpointId))
+ .build();
+ return client.call("PATCH", url)
+ .json(updateWebhookEndpointRequest)
+ .errors(com.meteroid.models.RestErrorResponse.class, "400", "401", "404", "429")
+ .options(requestOptions)
+ .returning(WebhookEndpoint.class);
+ }
+
+ /**
+ * List deliveries for a webhook endpoint
+ *
+ * @param endpointId the {@code endpoint_id} path parameter
+ * @return the page: the response body, its items and the way to the next pages
+ */
+ public WebhookEndpointsEndpointsListDeliveriesPage listDeliveries(final String endpointId) {
+ return listDeliveries(
+ endpointId,
+ WebhookEndpointsEndpointsListDeliveriesOptions.none(),
+ RequestOptions.none());
+ }
+
+ /**
+ * List deliveries for a webhook endpoint
+ *
+ * @param endpointId the {@code endpoint_id} path parameter
+ * @param options the optional parameters
+ * @return the page: the response body, its items and the way to the next pages
+ */
+ public WebhookEndpointsEndpointsListDeliveriesPage listDeliveries(
+ final String endpointId, final WebhookEndpointsEndpointsListDeliveriesOptions options) {
+ return listDeliveries(endpointId, options, RequestOptions.none());
+ }
+
+ /**
+ * List deliveries for a webhook endpoint
+ *
+ * @param endpointId the {@code endpoint_id} path parameter
+ * @param requestOptions headers, timeout and retries of this call
+ * @return the page: the response body, its items and the way to the next pages
+ */
+ public WebhookEndpointsEndpointsListDeliveriesPage listDeliveries(
+ final String endpointId, final RequestOptions requestOptions) {
+ return listDeliveries(
+ endpointId, WebhookEndpointsEndpointsListDeliveriesOptions.none(), requestOptions);
+ }
+
+ /**
+ * List deliveries for a webhook endpoint
+ *
+ * @param endpointId the {@code endpoint_id} path parameter
+ * @param options the optional parameters
+ * @param requestOptions headers, timeout and retries of this call
+ * @return the page: the response body, its items and the way to the next pages
+ */
+ public WebhookEndpointsEndpointsListDeliveriesPage listDeliveries(
+ final String endpointId,
+ final WebhookEndpointsEndpointsListDeliveriesOptions options,
+ final RequestOptions requestOptions) {
+ return pageOfListDeliveries(
+ exchangeListDeliveries(endpointId, options, requestOptions).send(),
+ endpointId,
+ options,
+ requestOptions);
+ }
+
+ MeteroidHttpClient.Exchange exchangeListDeliveries(
+ final String endpointId,
+ final WebhookEndpointsEndpointsListDeliveriesOptions options,
+ final RequestOptions requestOptions) {
+ Objects.requireNonNull(endpointId, "endpoint_id");
+ Objects.requireNonNull(options, "options");
+ HttpUrl.Builder url =
+ client.newUrlBuilder()
+ .addPathSegments("api/v1/webhooks/endpoints")
+ .addPathSegment(Utils.pathSegment("endpoint_id", endpointId))
+ .addPathSegments("deliveries");
+ WebhookDeliveryStatus value1 = options.status().orElse(null);
+ if (value1 != null) {
+ url.addQueryParameter("status", Utils.serializeQueryParam(value1));
+ }
+ Integer value2 = options.page().orElse(null);
+ if (value2 != null) {
+ url.addQueryParameter("page", Utils.serializeQueryParam(value2));
+ }
+ Integer value3 = options.perPage().orElse(null);
+ if (value3 != null) {
+ url.addQueryParameter("per_page", Utils.serializeQueryParam(value3));
+ }
+ return client.call("GET", url.build())
+ .errors(com.meteroid.models.RestErrorResponse.class, "401", "404", "429")
+ .options(requestOptions)
+ .returning(WebhookDeliveryListResponse.class);
+ }
+
+ private WebhookEndpointsEndpointsListDeliveriesPage pageOfListDeliveries(
+ WebhookDeliveryListResponse response,
+ final String endpointId,
+ final WebhookEndpointsEndpointsListDeliveriesOptions options,
+ final RequestOptions requestOptions) {
+ List items = itemsOfListDeliveries(response);
+ Integer next = nextOfListDeliveries(response, items, options.page().orElse(0));
+ return new WebhookEndpointsEndpointsListDeliveriesPage(
+ response,
+ items,
+ next == null
+ ? null
+ : () ->
+ listDeliveries(
+ endpointId,
+ options.toBuilder().page(next).build(),
+ requestOptions));
+ }
+
+ static List itemsOfListDeliveries(WebhookDeliveryListResponse response) {
+ return Utils.optional(response.data()).orElse(List.of());
+ }
+
+ /** The parameter of the page after {@code response}, null after the last one. */
+ static Integer nextOfListDeliveries(
+ WebhookDeliveryListResponse response, List items, Integer current) {
+ if (items.isEmpty()) {
+ return null;
+ }
+ long pages =
+ Utils.optional(response.paginationMeta())
+ .flatMap(v2 -> Utils.optional(v2.totalPages()))
+ .map(Number::longValue)
+ .orElse(Long.MAX_VALUE);
+ if (current - 0 + 1 >= pages) {
+ return null;
+ }
+ return current + 1;
+ }
+
+ /**
+ * Rotate a webhook endpoint secret
+ *
+ *
The previous secret keeps signing alongside the new one for 24 hours, so consumers can
+ * roll over without dropping events.
+ *
+ * @param endpointId the {@code endpoint_id} path parameter
+ * @return the response body
+ */
+ public WebhookEndpointSecret rotateSecret(final String endpointId) {
+ return rotateSecret(endpointId, RequestOptions.none());
+ }
+
+ /**
+ * Rotate a webhook endpoint secret
+ *
+ *
The previous secret keeps signing alongside the new one for 24 hours, so consumers can
+ * roll over without dropping events.
+ *
+ * @param endpointId the {@code endpoint_id} path parameter
+ * @param requestOptions headers, timeout and retries of this call
+ * @return the response body
+ */
+ public WebhookEndpointSecret rotateSecret(
+ final String endpointId, final RequestOptions requestOptions) {
+ return exchangeRotateSecret(endpointId, requestOptions).send();
+ }
+
+ MeteroidHttpClient.Exchange exchangeRotateSecret(
+ final String endpointId, final RequestOptions requestOptions) {
+ Objects.requireNonNull(endpointId, "endpoint_id");
+ HttpUrl url =
+ client.newUrlBuilder()
+ .addPathSegments("api/v1/webhooks/endpoints")
+ .addPathSegment(Utils.pathSegment("endpoint_id", endpointId))
+ .addPathSegments("rotate-secret")
+ .build();
+ return client.call("POST", url)
+ .errors(com.meteroid.models.RestErrorResponse.class, "401", "404", "429")
+ .options(requestOptions)
+ .returning(WebhookEndpointSecret.class);
+ }
+
+ /**
+ * Reveal a webhook endpoint secret
+ *
+ * @param endpointId the {@code endpoint_id} path parameter
+ * @return the response body
+ */
+ public WebhookEndpointSecret retrieveSecret(final String endpointId) {
+ return retrieveSecret(endpointId, RequestOptions.none());
+ }
+
+ /**
+ * Reveal a webhook endpoint secret
+ *
+ * @param endpointId the {@code endpoint_id} path parameter
+ * @param requestOptions headers, timeout and retries of this call
+ * @return the response body
+ */
+ public WebhookEndpointSecret retrieveSecret(
+ final String endpointId, final RequestOptions requestOptions) {
+ return exchangeRetrieveSecret(endpointId, requestOptions).send();
+ }
+
+ MeteroidHttpClient.Exchange exchangeRetrieveSecret(
+ final String endpointId, final RequestOptions requestOptions) {
+ Objects.requireNonNull(endpointId, "endpoint_id");
+ HttpUrl url =
+ client.newUrlBuilder()
+ .addPathSegments("api/v1/webhooks/endpoints")
+ .addPathSegment(Utils.pathSegment("endpoint_id", endpointId))
+ .addPathSegments("secret")
+ .build();
+ return client.call("GET", url)
+ .errors(com.meteroid.models.RestErrorResponse.class, "401", "404", "429")
+ .options(requestOptions)
+ .returning(WebhookEndpointSecret.class);
+ }
+
+ /** The operations, returning the status and headers along with the body. */
+ public final class WithRawResponse {
+ private WithRawResponse() {}
+
+ /**
+ * List webhook endpoints
+ *
+ * @return the status, headers and body
+ */
+ public ApiResponse list() {
+ return list(RequestOptions.none());
+ }
+
+ /**
+ * List webhook endpoints
+ *
+ * @param requestOptions headers, timeout and retries of this call
+ * @return the status, headers and body
+ */
+ public ApiResponse list(final RequestOptions requestOptions) {
+ return WebhookEndpointsEndpoints.this.exchangeList(requestOptions).sendRaw();
+ }
+
+ /**
+ * Create a webhook endpoint
+ *
+ *
The signing secret is returned once, in this response only.
+ *
+ * @param createWebhookEndpointRequest the request body
+ * @return the status, headers and body
+ */
+ public ApiResponse create(
+ final CreateWebhookEndpointRequest createWebhookEndpointRequest) {
+ return create(createWebhookEndpointRequest, RequestOptions.none());
+ }
+
+ /**
+ * Create a webhook endpoint
+ *
+ *
The signing secret is returned once, in this response only.
+ *
+ * @param createWebhookEndpointRequest the request body
+ * @param requestOptions headers, timeout and retries of this call
+ * @return the status, headers and body
+ */
+ public ApiResponse create(
+ final CreateWebhookEndpointRequest createWebhookEndpointRequest,
+ final RequestOptions requestOptions) {
+ return WebhookEndpointsEndpoints.this
+ .exchangeCreate(createWebhookEndpointRequest, requestOptions)
+ .sendRaw();
+ }
+
+ /**
+ * Get a webhook endpoint
+ *
+ * @param endpointId the {@code endpoint_id} path parameter
+ * @return the status, headers and body
+ */
+ public ApiResponse retrieve(final String endpointId) {
+ return retrieve(endpointId, RequestOptions.none());
+ }
+
+ /**
+ * Get a webhook endpoint
+ *
+ * @param endpointId the {@code endpoint_id} path parameter
+ * @param requestOptions headers, timeout and retries of this call
+ * @return the status, headers and body
+ */
+ public ApiResponse retrieve(
+ final String endpointId, final RequestOptions requestOptions) {
+ return WebhookEndpointsEndpoints.this
+ .exchangeRetrieve(endpointId, requestOptions)
+ .sendRaw();
+ }
+
+ /**
+ * Delete a webhook endpoint
+ *
+ *
The endpoint is archived and its pending deliveries are cancelled.
+ *
+ * @param endpointId the {@code endpoint_id} path parameter
+ * @return the status, headers and body
+ */
+ public ApiResponse delete(final String endpointId) {
+ return delete(endpointId, RequestOptions.none());
+ }
+
+ /**
+ * Delete a webhook endpoint
+ *
+ *
The endpoint is archived and its pending deliveries are cancelled.
+ *
+ * @param endpointId the {@code endpoint_id} path parameter
+ * @param requestOptions headers, timeout and retries of this call
+ * @return the status, headers and body
+ */
+ public ApiResponse delete(
+ final String endpointId, final RequestOptions requestOptions) {
+ return WebhookEndpointsEndpoints.this
+ .exchangeDelete(endpointId, requestOptions)
+ .sendRaw();
+ }
+
+ /**
+ * Update a webhook endpoint
+ *
+ *
Omitted fields are left untouched. Re-enabling a disabled endpoint resets its
+ * consecutive failure count.
+ *
+ * @param endpointId the {@code endpoint_id} path parameter
+ * @param updateWebhookEndpointRequest the request body
+ * @return the status, headers and body
+ */
+ public ApiResponse update(
+ final String endpointId,
+ final UpdateWebhookEndpointRequest updateWebhookEndpointRequest) {
+ return update(endpointId, updateWebhookEndpointRequest, RequestOptions.none());
+ }
+
+ /**
+ * Update a webhook endpoint
+ *
+ *
Omitted fields are left untouched. Re-enabling a disabled endpoint resets its
+ * consecutive failure count.
+ *
+ * @param endpointId the {@code endpoint_id} path parameter
+ * @param updateWebhookEndpointRequest the request body
+ * @param requestOptions headers, timeout and retries of this call
+ * @return the status, headers and body
+ */
+ public ApiResponse update(
+ final String endpointId,
+ final UpdateWebhookEndpointRequest updateWebhookEndpointRequest,
+ final RequestOptions requestOptions) {
+ return WebhookEndpointsEndpoints.this
+ .exchangeUpdate(endpointId, updateWebhookEndpointRequest, requestOptions)
+ .sendRaw();
+ }
+
+ /**
+ * List deliveries for a webhook endpoint
+ *
+ * @param endpointId the {@code endpoint_id} path parameter
+ * @return the status, headers and page
+ */
+ public ApiResponse listDeliveries(
+ final String endpointId) {
+ return listDeliveries(
+ endpointId,
+ WebhookEndpointsEndpointsListDeliveriesOptions.none(),
+ RequestOptions.none());
+ }
+
+ /**
+ * List deliveries for a webhook endpoint
+ *
+ * @param endpointId the {@code endpoint_id} path parameter
+ * @param options the optional parameters
+ * @return the status, headers and page
+ */
+ public ApiResponse listDeliveries(
+ final String endpointId,
+ final WebhookEndpointsEndpointsListDeliveriesOptions options) {
+ return listDeliveries(endpointId, options, RequestOptions.none());
+ }
+
+ /**
+ * List deliveries for a webhook endpoint
+ *
+ * @param endpointId the {@code endpoint_id} path parameter
+ * @param requestOptions headers, timeout and retries of this call
+ * @return the status, headers and page
+ */
+ public ApiResponse listDeliveries(
+ final String endpointId, final RequestOptions requestOptions) {
+ return listDeliveries(
+ endpointId,
+ WebhookEndpointsEndpointsListDeliveriesOptions.none(),
+ requestOptions);
+ }
+
+ /**
+ * List deliveries for a webhook endpoint
+ *
+ * @param endpointId the {@code endpoint_id} path parameter
+ * @param options the optional parameters
+ * @param requestOptions headers, timeout and retries of this call
+ * @return the status, headers and page
+ */
+ public ApiResponse listDeliveries(
+ final String endpointId,
+ final WebhookEndpointsEndpointsListDeliveriesOptions options,
+ final RequestOptions requestOptions) {
+ ApiResponse response =
+ exchangeListDeliveries(endpointId, options, requestOptions).sendRaw();
+ return new ApiResponse<>(
+ response.statusCode(),
+ response.headers(),
+ pageOfListDeliveries(response.body(), endpointId, options, requestOptions));
+ }
+
+ /**
+ * Rotate a webhook endpoint secret
+ *
+ *
The previous secret keeps signing alongside the new one for 24 hours, so consumers can
+ * roll over without dropping events.
+ *
+ * @param endpointId the {@code endpoint_id} path parameter
+ * @return the status, headers and body
+ */
+ public ApiResponse rotateSecret(final String endpointId) {
+ return rotateSecret(endpointId, RequestOptions.none());
+ }
+
+ /**
+ * Rotate a webhook endpoint secret
+ *
+ *
The previous secret keeps signing alongside the new one for 24 hours, so consumers can
+ * roll over without dropping events.
+ *
+ * @param endpointId the {@code endpoint_id} path parameter
+ * @param requestOptions headers, timeout and retries of this call
+ * @return the status, headers and body
+ */
+ public ApiResponse rotateSecret(
+ final String endpointId, final RequestOptions requestOptions) {
+ return WebhookEndpointsEndpoints.this
+ .exchangeRotateSecret(endpointId, requestOptions)
+ .sendRaw();
+ }
+
+ /**
+ * Reveal a webhook endpoint secret
+ *
+ * @param endpointId the {@code endpoint_id} path parameter
+ * @return the status, headers and body
+ */
+ public ApiResponse retrieveSecret(final String endpointId) {
+ return retrieveSecret(endpointId, RequestOptions.none());
+ }
+
+ /**
+ * Reveal a webhook endpoint secret
+ *
+ * @param endpointId the {@code endpoint_id} path parameter
+ * @param requestOptions headers, timeout and retries of this call
+ * @return the status, headers and body
+ */
+ public ApiResponse retrieveSecret(
+ final String endpointId, final RequestOptions requestOptions) {
+ return WebhookEndpointsEndpoints.this
+ .exchangeRetrieveSecret(endpointId, requestOptions)
+ .sendRaw();
+ }
+ }
+}
diff --git a/src/main/java/com/meteroid/api/WebhookEndpointsEndpointsAsync.java b/src/main/java/com/meteroid/api/WebhookEndpointsEndpointsAsync.java
new file mode 100644
index 0000000..a953585
--- /dev/null
+++ b/src/main/java/com/meteroid/api/WebhookEndpointsEndpointsAsync.java
@@ -0,0 +1,563 @@
+// this file is @generated
+package com.meteroid.api;
+
+import com.meteroid.ApiResponse;
+import com.meteroid.RequestOptions;
+import com.meteroid.models.CreateWebhookEndpointRequest;
+import com.meteroid.models.CreatedWebhookEndpoint;
+import com.meteroid.models.UpdateWebhookEndpointRequest;
+import com.meteroid.models.WebhookDelivery;
+import com.meteroid.models.WebhookDeliveryListResponse;
+import com.meteroid.models.WebhookEndpoint;
+import com.meteroid.models.WebhookEndpointListResponse;
+import com.meteroid.models.WebhookEndpointSecret;
+
+import java.util.List;
+import java.util.concurrent.CompletableFuture;
+
+/**
+ * The {@code webhook_endpoints.endpoints} operations, without blocking: each method returns a
+ * {@link CompletableFuture}. Obtained from {@code client.async()}.
+ */
+public final class WebhookEndpointsEndpointsAsync {
+ private final WebhookEndpointsEndpoints sync;
+ private final WithRawResponse withRawResponse;
+
+ /**
+ * The operations, sending through {@code sync}.
+ *
+ * @param sync the blocking operations
+ */
+ public WebhookEndpointsEndpointsAsync(WebhookEndpointsEndpoints sync) {
+ this.sync = sync;
+ this.withRawResponse = new WithRawResponse();
+ }
+
+ /**
+ * The same operations, returning the status and headers along with the body.
+ *
+ * @return the operations
+ */
+ public WithRawResponse withRawResponse() {
+ return withRawResponse;
+ }
+
+ /**
+ * List webhook endpoints
+ *
+ * @return the response body, once received
+ */
+ public CompletableFuture list() {
+ return list(RequestOptions.none());
+ }
+
+ /**
+ * List webhook endpoints
+ *
+ * @param requestOptions headers, timeout and retries of this call
+ * @return the response body, once received
+ */
+ public CompletableFuture list(
+ final RequestOptions requestOptions) {
+ return sync.exchangeList(requestOptions).sendAsync();
+ }
+
+ /**
+ * Create a webhook endpoint
+ *
+ *
The signing secret is returned once, in this response only.
+ *
+ * @param createWebhookEndpointRequest the request body
+ * @return the response body, once received
+ */
+ public CompletableFuture create(
+ final CreateWebhookEndpointRequest createWebhookEndpointRequest) {
+ return create(createWebhookEndpointRequest, RequestOptions.none());
+ }
+
+ /**
+ * Create a webhook endpoint
+ *
+ *
The signing secret is returned once, in this response only.
+ *
+ * @param createWebhookEndpointRequest the request body
+ * @param requestOptions headers, timeout and retries of this call
+ * @return the response body, once received
+ */
+ public CompletableFuture create(
+ final CreateWebhookEndpointRequest createWebhookEndpointRequest,
+ final RequestOptions requestOptions) {
+ return sync.exchangeCreate(createWebhookEndpointRequest, requestOptions).sendAsync();
+ }
+
+ /**
+ * Get a webhook endpoint
+ *
+ * @param endpointId the {@code endpoint_id} path parameter
+ * @return the response body, once received
+ */
+ public CompletableFuture retrieve(final String endpointId) {
+ return retrieve(endpointId, RequestOptions.none());
+ }
+
+ /**
+ * Get a webhook endpoint
+ *
+ * @param endpointId the {@code endpoint_id} path parameter
+ * @param requestOptions headers, timeout and retries of this call
+ * @return the response body, once received
+ */
+ public CompletableFuture retrieve(
+ final String endpointId, final RequestOptions requestOptions) {
+ return sync.exchangeRetrieve(endpointId, requestOptions).sendAsync();
+ }
+
+ /**
+ * Delete a webhook endpoint
+ *
+ *
The endpoint is archived and its pending deliveries are cancelled.
+ *
+ * @param endpointId the {@code endpoint_id} path parameter
+ * @return the response body, once received
+ */
+ public CompletableFuture delete(final String endpointId) {
+ return delete(endpointId, RequestOptions.none());
+ }
+
+ /**
+ * Delete a webhook endpoint
+ *
+ *
The endpoint is archived and its pending deliveries are cancelled.
+ *
+ * @param endpointId the {@code endpoint_id} path parameter
+ * @param requestOptions headers, timeout and retries of this call
+ * @return the response body, once received
+ */
+ public CompletableFuture delete(
+ final String endpointId, final RequestOptions requestOptions) {
+ return sync.exchangeDelete(endpointId, requestOptions).sendAsync();
+ }
+
+ /**
+ * Update a webhook endpoint
+ *
+ *
Omitted fields are left untouched. Re-enabling a disabled endpoint resets its consecutive
+ * failure count.
+ *
+ * @param endpointId the {@code endpoint_id} path parameter
+ * @param updateWebhookEndpointRequest the request body
+ * @return the response body, once received
+ */
+ public CompletableFuture update(
+ final String endpointId,
+ final UpdateWebhookEndpointRequest updateWebhookEndpointRequest) {
+ return update(endpointId, updateWebhookEndpointRequest, RequestOptions.none());
+ }
+
+ /**
+ * Update a webhook endpoint
+ *
+ *
Omitted fields are left untouched. Re-enabling a disabled endpoint resets its consecutive
+ * failure count.
+ *
+ * @param endpointId the {@code endpoint_id} path parameter
+ * @param updateWebhookEndpointRequest the request body
+ * @param requestOptions headers, timeout and retries of this call
+ * @return the response body, once received
+ */
+ public CompletableFuture update(
+ final String endpointId,
+ final UpdateWebhookEndpointRequest updateWebhookEndpointRequest,
+ final RequestOptions requestOptions) {
+ return sync.exchangeUpdate(endpointId, updateWebhookEndpointRequest, requestOptions)
+ .sendAsync();
+ }
+
+ /**
+ * List deliveries for a webhook endpoint
+ *
+ * @param endpointId the {@code endpoint_id} path parameter
+ * @return the page, once received
+ */
+ public CompletableFuture listDeliveries(
+ final String endpointId) {
+ return listDeliveries(
+ endpointId,
+ WebhookEndpointsEndpointsListDeliveriesOptions.none(),
+ RequestOptions.none());
+ }
+
+ /**
+ * List deliveries for a webhook endpoint
+ *
+ * @param endpointId the {@code endpoint_id} path parameter
+ * @param options the optional parameters
+ * @return the page, once received
+ */
+ public CompletableFuture listDeliveries(
+ final String endpointId, final WebhookEndpointsEndpointsListDeliveriesOptions options) {
+ return listDeliveries(endpointId, options, RequestOptions.none());
+ }
+
+ /**
+ * List deliveries for a webhook endpoint
+ *
+ * @param endpointId the {@code endpoint_id} path parameter
+ * @param requestOptions headers, timeout and retries of this call
+ * @return the page, once received
+ */
+ public CompletableFuture listDeliveries(
+ final String endpointId, final RequestOptions requestOptions) {
+ return listDeliveries(
+ endpointId, WebhookEndpointsEndpointsListDeliveriesOptions.none(), requestOptions);
+ }
+
+ /**
+ * List deliveries for a webhook endpoint
+ *
+ * @param endpointId the {@code endpoint_id} path parameter
+ * @param options the optional parameters
+ * @param requestOptions headers, timeout and retries of this call
+ * @return the page, once received
+ */
+ public CompletableFuture listDeliveries(
+ final String endpointId,
+ final WebhookEndpointsEndpointsListDeliveriesOptions options,
+ final RequestOptions requestOptions) {
+ return sync.exchangeListDeliveries(endpointId, options, requestOptions)
+ .sendAsync()
+ .thenApply(
+ response ->
+ pageOfListDeliveries(
+ response, endpointId, options, requestOptions));
+ }
+
+ private WebhookEndpointsEndpointsListDeliveriesAsyncPage pageOfListDeliveries(
+ WebhookDeliveryListResponse response,
+ final String endpointId,
+ final WebhookEndpointsEndpointsListDeliveriesOptions options,
+ final RequestOptions requestOptions) {
+ List items = WebhookEndpointsEndpoints.itemsOfListDeliveries(response);
+ Integer next =
+ WebhookEndpointsEndpoints.nextOfListDeliveries(
+ response, items, options.page().orElse(0));
+ return new WebhookEndpointsEndpointsListDeliveriesAsyncPage(
+ response,
+ items,
+ next == null
+ ? null
+ : () ->
+ listDeliveries(
+ endpointId,
+ options.toBuilder().page(next).build(),
+ requestOptions));
+ }
+
+ /**
+ * Rotate a webhook endpoint secret
+ *
+ *
The previous secret keeps signing alongside the new one for 24 hours, so consumers can
+ * roll over without dropping events.
+ *
+ * @param endpointId the {@code endpoint_id} path parameter
+ * @return the response body, once received
+ */
+ public CompletableFuture rotateSecret(final String endpointId) {
+ return rotateSecret(endpointId, RequestOptions.none());
+ }
+
+ /**
+ * Rotate a webhook endpoint secret
+ *
+ *
The previous secret keeps signing alongside the new one for 24 hours, so consumers can
+ * roll over without dropping events.
+ *
+ * @param endpointId the {@code endpoint_id} path parameter
+ * @param requestOptions headers, timeout and retries of this call
+ * @return the response body, once received
+ */
+ public CompletableFuture rotateSecret(
+ final String endpointId, final RequestOptions requestOptions) {
+ return sync.exchangeRotateSecret(endpointId, requestOptions).sendAsync();
+ }
+
+ /**
+ * Reveal a webhook endpoint secret
+ *
+ * @param endpointId the {@code endpoint_id} path parameter
+ * @return the response body, once received
+ */
+ public CompletableFuture retrieveSecret(final String endpointId) {
+ return retrieveSecret(endpointId, RequestOptions.none());
+ }
+
+ /**
+ * Reveal a webhook endpoint secret
+ *
+ * @param endpointId the {@code endpoint_id} path parameter
+ * @param requestOptions headers, timeout and retries of this call
+ * @return the response body, once received
+ */
+ public CompletableFuture retrieveSecret(
+ final String endpointId, final RequestOptions requestOptions) {
+ return sync.exchangeRetrieveSecret(endpointId, requestOptions).sendAsync();
+ }
+
+ /** The operations, returning the status and headers along with the body. */
+ public final class WithRawResponse {
+ private WithRawResponse() {}
+
+ /**
+ * List webhook endpoints
+ *
+ * @return the status, headers and body, once received
+ */
+ public CompletableFuture> list() {
+ return list(RequestOptions.none());
+ }
+
+ /**
+ * List webhook endpoints
+ *
+ * @param requestOptions headers, timeout and retries of this call
+ * @return the status, headers and body, once received
+ */
+ public CompletableFuture> list(
+ final RequestOptions requestOptions) {
+ return sync.exchangeList(requestOptions).sendRawAsync();
+ }
+
+ /**
+ * Create a webhook endpoint
+ *
+ *
The signing secret is returned once, in this response only.
+ *
+ * @param createWebhookEndpointRequest the request body
+ * @return the status, headers and body, once received
+ */
+ public CompletableFuture> create(
+ final CreateWebhookEndpointRequest createWebhookEndpointRequest) {
+ return create(createWebhookEndpointRequest, RequestOptions.none());
+ }
+
+ /**
+ * Create a webhook endpoint
+ *
+ *
The signing secret is returned once, in this response only.
+ *
+ * @param createWebhookEndpointRequest the request body
+ * @param requestOptions headers, timeout and retries of this call
+ * @return the status, headers and body, once received
+ */
+ public CompletableFuture> create(
+ final CreateWebhookEndpointRequest createWebhookEndpointRequest,
+ final RequestOptions requestOptions) {
+ return sync.exchangeCreate(createWebhookEndpointRequest, requestOptions).sendRawAsync();
+ }
+
+ /**
+ * Get a webhook endpoint
+ *
+ * @param endpointId the {@code endpoint_id} path parameter
+ * @return the status, headers and body, once received
+ */
+ public CompletableFuture> retrieve(final String endpointId) {
+ return retrieve(endpointId, RequestOptions.none());
+ }
+
+ /**
+ * Get a webhook endpoint
+ *
+ * @param endpointId the {@code endpoint_id} path parameter
+ * @param requestOptions headers, timeout and retries of this call
+ * @return the status, headers and body, once received
+ */
+ public CompletableFuture> retrieve(
+ final String endpointId, final RequestOptions requestOptions) {
+ return sync.exchangeRetrieve(endpointId, requestOptions).sendRawAsync();
+ }
+
+ /**
+ * Delete a webhook endpoint
+ *
+ *
The endpoint is archived and its pending deliveries are cancelled.
+ *
+ * @param endpointId the {@code endpoint_id} path parameter
+ * @return the status, headers and body, once received
+ */
+ public CompletableFuture> delete(final String endpointId) {
+ return delete(endpointId, RequestOptions.none());
+ }
+
+ /**
+ * Delete a webhook endpoint
+ *
+ *
The endpoint is archived and its pending deliveries are cancelled.
+ *
+ * @param endpointId the {@code endpoint_id} path parameter
+ * @param requestOptions headers, timeout and retries of this call
+ * @return the status, headers and body, once received
+ */
+ public CompletableFuture> delete(
+ final String endpointId, final RequestOptions requestOptions) {
+ return sync.exchangeDelete(endpointId, requestOptions).sendRawAsync();
+ }
+
+ /**
+ * Update a webhook endpoint
+ *
+ *
Omitted fields are left untouched. Re-enabling a disabled endpoint resets its
+ * consecutive failure count.
+ *
+ * @param endpointId the {@code endpoint_id} path parameter
+ * @param updateWebhookEndpointRequest the request body
+ * @return the status, headers and body, once received
+ */
+ public CompletableFuture> update(
+ final String endpointId,
+ final UpdateWebhookEndpointRequest updateWebhookEndpointRequest) {
+ return update(endpointId, updateWebhookEndpointRequest, RequestOptions.none());
+ }
+
+ /**
+ * Update a webhook endpoint
+ *
+ *
Omitted fields are left untouched. Re-enabling a disabled endpoint resets its
+ * consecutive failure count.
+ *
+ * @param endpointId the {@code endpoint_id} path parameter
+ * @param updateWebhookEndpointRequest the request body
+ * @param requestOptions headers, timeout and retries of this call
+ * @return the status, headers and body, once received
+ */
+ public CompletableFuture> update(
+ final String endpointId,
+ final UpdateWebhookEndpointRequest updateWebhookEndpointRequest,
+ final RequestOptions requestOptions) {
+ return sync.exchangeUpdate(endpointId, updateWebhookEndpointRequest, requestOptions)
+ .sendRawAsync();
+ }
+
+ /**
+ * List deliveries for a webhook endpoint
+ *
+ * @param endpointId the {@code endpoint_id} path parameter
+ * @return the status, headers and page, once received
+ */
+ public CompletableFuture>
+ listDeliveries(final String endpointId) {
+ return listDeliveries(
+ endpointId,
+ WebhookEndpointsEndpointsListDeliveriesOptions.none(),
+ RequestOptions.none());
+ }
+
+ /**
+ * List deliveries for a webhook endpoint
+ *
+ * @param endpointId the {@code endpoint_id} path parameter
+ * @param options the optional parameters
+ * @return the status, headers and page, once received
+ */
+ public CompletableFuture>
+ listDeliveries(
+ final String endpointId,
+ final WebhookEndpointsEndpointsListDeliveriesOptions options) {
+ return listDeliveries(endpointId, options, RequestOptions.none());
+ }
+
+ /**
+ * List deliveries for a webhook endpoint
+ *
+ * @param endpointId the {@code endpoint_id} path parameter
+ * @param requestOptions headers, timeout and retries of this call
+ * @return the status, headers and page, once received
+ */
+ public CompletableFuture>
+ listDeliveries(final String endpointId, final RequestOptions requestOptions) {
+ return listDeliveries(
+ endpointId,
+ WebhookEndpointsEndpointsListDeliveriesOptions.none(),
+ requestOptions);
+ }
+
+ /**
+ * List deliveries for a webhook endpoint
+ *
+ * @param endpointId the {@code endpoint_id} path parameter
+ * @param options the optional parameters
+ * @param requestOptions headers, timeout and retries of this call
+ * @return the status, headers and page, once received
+ */
+ public CompletableFuture>
+ listDeliveries(
+ final String endpointId,
+ final WebhookEndpointsEndpointsListDeliveriesOptions options,
+ final RequestOptions requestOptions) {
+ return sync.exchangeListDeliveries(endpointId, options, requestOptions)
+ .sendRawAsync()
+ .thenApply(
+ response ->
+ new ApiResponse<>(
+ response.statusCode(),
+ response.headers(),
+ pageOfListDeliveries(
+ response.body(),
+ endpointId,
+ options,
+ requestOptions)));
+ }
+
+ /**
+ * Rotate a webhook endpoint secret
+ *
+ *
The previous secret keeps signing alongside the new one for 24 hours, so consumers can
+ * roll over without dropping events.
+ *
+ * @param endpointId the {@code endpoint_id} path parameter
+ * @return the status, headers and body, once received
+ */
+ public CompletableFuture> rotateSecret(
+ final String endpointId) {
+ return rotateSecret(endpointId, RequestOptions.none());
+ }
+
+ /**
+ * Rotate a webhook endpoint secret
+ *
+ *
The previous secret keeps signing alongside the new one for 24 hours, so consumers can
+ * roll over without dropping events.
+ *
+ * @param endpointId the {@code endpoint_id} path parameter
+ * @param requestOptions headers, timeout and retries of this call
+ * @return the status, headers and body, once received
+ */
+ public CompletableFuture> rotateSecret(
+ final String endpointId, final RequestOptions requestOptions) {
+ return sync.exchangeRotateSecret(endpointId, requestOptions).sendRawAsync();
+ }
+
+ /**
+ * Reveal a webhook endpoint secret
+ *
+ * @param endpointId the {@code endpoint_id} path parameter
+ * @return the status, headers and body, once received
+ */
+ public CompletableFuture> retrieveSecret(
+ final String endpointId) {
+ return retrieveSecret(endpointId, RequestOptions.none());
+ }
+
+ /**
+ * Reveal a webhook endpoint secret
+ *
+ * @param endpointId the {@code endpoint_id} path parameter
+ * @param requestOptions headers, timeout and retries of this call
+ * @return the status, headers and body, once received
+ */
+ public CompletableFuture> retrieveSecret(
+ final String endpointId, final RequestOptions requestOptions) {
+ return sync.exchangeRetrieveSecret(endpointId, requestOptions).sendRawAsync();
+ }
+ }
+}
diff --git a/src/main/java/com/meteroid/api/WebhookEndpointsEndpointsListDeliveriesAsyncPage.java b/src/main/java/com/meteroid/api/WebhookEndpointsEndpointsListDeliveriesAsyncPage.java
new file mode 100644
index 0000000..706f821
--- /dev/null
+++ b/src/main/java/com/meteroid/api/WebhookEndpointsEndpointsListDeliveriesAsyncPage.java
@@ -0,0 +1,71 @@
+// this file is @generated
+package com.meteroid.api;
+
+import com.meteroid.AsyncPage;
+import com.meteroid.models.PaginationResponse;
+import com.meteroid.models.WebhookDelivery;
+import com.meteroid.models.WebhookDeliveryListResponse;
+
+import java.util.List;
+import java.util.concurrent.CompletableFuture;
+import java.util.function.Supplier;
+
+/**
+ * A page of {@link WebhookEndpointsEndpointsAsync#listDeliveries}: the {@link WebhookDelivery}
+ * items of one response, and the properties of its body, {@link WebhookDeliveryListResponse}.
+ */
+public final class WebhookEndpointsEndpointsListDeliveriesAsyncPage
+ extends AsyncPage {
+ private final WebhookDeliveryListResponse body;
+
+ /**
+ * A page, built by the SDK.
+ *
+ * @param body the response body
+ * @param items the items of the page
+ * @param next fetches the next page, or null on the last page
+ */
+ public WebhookEndpointsEndpointsListDeliveriesAsyncPage(
+ WebhookDeliveryListResponse body,
+ List items,
+ Supplier> next) {
+ super(items, next);
+ this.body = body;
+ }
+
+ /**
+ * The response body, as received.
+ *
+ * @return the body
+ */
+ public WebhookDeliveryListResponse body() {
+ return body;
+ }
+
+ /**
+ * The {@code data} property.
+ *
+ * @return the value, never null
+ */
+ public List data() {
+ return body.data();
+ }
+
+ /**
+ * The {@code pagination_meta} property.
+ *
+ * @return the value, never null
+ */
+ public PaginationResponse paginationMeta() {
+ return body.paginationMeta();
+ }
+
+ @Override
+ public String toString() {
+ return "WebhookEndpointsEndpointsListDeliveriesAsyncPage{body="
+ + body
+ + ", hasNextPage="
+ + hasNextPage()
+ + "}";
+ }
+}
diff --git a/src/main/java/com/meteroid/api/WebhookEndpointsEndpointsListDeliveriesOptions.java b/src/main/java/com/meteroid/api/WebhookEndpointsEndpointsListDeliveriesOptions.java
new file mode 100644
index 0000000..0d09652
--- /dev/null
+++ b/src/main/java/com/meteroid/api/WebhookEndpointsEndpointsListDeliveriesOptions.java
@@ -0,0 +1,161 @@
+// this file is @generated
+package com.meteroid.api;
+
+import com.meteroid.models.WebhookDeliveryStatus;
+
+import java.util.Objects;
+import java.util.Optional;
+
+/** Optional parameters of {@code listDeliveries}, immutable: build them with {@link #builder()}. */
+public final class WebhookEndpointsEndpointsListDeliveriesOptions {
+ private final WebhookDeliveryStatus status;
+ private final Integer page;
+ private final Integer perPage;
+
+ private WebhookEndpointsEndpointsListDeliveriesOptions(Builder builder) {
+ this.status = builder.status;
+ this.page = builder.page;
+ this.perPage = builder.perPage;
+ }
+
+ /**
+ * A builder of parameters.
+ *
+ * @return a new builder
+ */
+ public static Builder builder() {
+ return new Builder();
+ }
+
+ /**
+ * No parameters.
+ *
+ * @return empty parameters
+ */
+ public static WebhookEndpointsEndpointsListDeliveriesOptions none() {
+ return builder().build();
+ }
+
+ /**
+ * A builder starting from these parameters.
+ *
+ * @return a new builder
+ */
+ public Builder toBuilder() {
+ Builder builder = new Builder();
+ builder.status = status;
+ builder.page = page;
+ builder.perPage = perPage;
+ return builder;
+ }
+
+ /**
+ * Only return deliveries in this state.
+ *
+ * @return the value, empty when unset
+ */
+ public Optional status() {
+ return Optional.ofNullable(status);
+ }
+
+ /**
+ * Page number (0-indexed)
+ *
+ * @return the value, empty when unset
+ */
+ public Optional page() {
+ return Optional.ofNullable(page);
+ }
+
+ /**
+ * Number of items per page
+ *
+ * @return the value, empty when unset
+ */
+ public Optional perPage() {
+ return Optional.ofNullable(perPage);
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ WebhookEndpointsEndpointsListDeliveriesOptions that =
+ (WebhookEndpointsEndpointsListDeliveriesOptions) o;
+ return Objects.equals(status, that.status)
+ && Objects.equals(page, that.page)
+ && Objects.equals(perPage, that.perPage);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(status, page, perPage);
+ }
+
+ @Override
+ public String toString() {
+ return "WebhookEndpointsEndpointsListDeliveriesOptions{"
+ + "status="
+ + status
+ + ", page="
+ + page
+ + ", perPage="
+ + perPage
+ + "}";
+ }
+
+ /** Builds {@link WebhookEndpointsEndpointsListDeliveriesOptions}. */
+ public static final class Builder {
+ private WebhookDeliveryStatus status;
+ private Integer page;
+ private Integer perPage;
+
+ private Builder() {}
+
+ /**
+ * Only return deliveries in this state.
+ *
+ * @param status the value, null to leave it out
+ * @return this builder
+ */
+ public Builder status(WebhookDeliveryStatus status) {
+ this.status = status;
+ return this;
+ }
+
+ /**
+ * Page number (0-indexed)
+ *
+ * @param page the value, null to leave it out
+ * @return this builder
+ */
+ public Builder page(Integer page) {
+ this.page = page;
+ return this;
+ }
+
+ /**
+ * Number of items per page
+ *
+ * @param perPage the value, null to leave it out
+ * @return this builder
+ */
+ public Builder perPage(Integer perPage) {
+ this.perPage = perPage;
+ return this;
+ }
+
+ /**
+ * The parameters.
+ *
+ * @return immutable parameters
+ */
+ public WebhookEndpointsEndpointsListDeliveriesOptions build() {
+ return new WebhookEndpointsEndpointsListDeliveriesOptions(this);
+ }
+ }
+}
diff --git a/src/main/java/com/meteroid/api/WebhookEndpointsEndpointsListDeliveriesPage.java b/src/main/java/com/meteroid/api/WebhookEndpointsEndpointsListDeliveriesPage.java
new file mode 100644
index 0000000..ccd40c8
--- /dev/null
+++ b/src/main/java/com/meteroid/api/WebhookEndpointsEndpointsListDeliveriesPage.java
@@ -0,0 +1,73 @@
+// this file is @generated
+package com.meteroid.api;
+
+import com.meteroid.Page;
+import com.meteroid.models.PaginationResponse;
+import com.meteroid.models.WebhookDelivery;
+import com.meteroid.models.WebhookDeliveryListResponse;
+
+import java.util.List;
+import java.util.function.Supplier;
+
+/**
+ * A page of {@link WebhookEndpointsEndpoints#listDeliveries}: the {@link WebhookDelivery} items of
+ * one response, and the properties of its body, {@link WebhookDeliveryListResponse}.
+ *
+ *
Iterating it yields every item from this page on, fetching the next pages as the iteration
+ * goes.
+ */
+public final class WebhookEndpointsEndpointsListDeliveriesPage
+ extends Page {
+ private final WebhookDeliveryListResponse body;
+
+ /**
+ * A page, built by the SDK.
+ *
+ * @param body the response body
+ * @param items the items of the page
+ * @param next fetches the next page, or null on the last page
+ */
+ public WebhookEndpointsEndpointsListDeliveriesPage(
+ WebhookDeliveryListResponse body,
+ List items,
+ Supplier next) {
+ super(items, next);
+ this.body = body;
+ }
+
+ /**
+ * The response body, as received.
+ *
+ * @return the body
+ */
+ public WebhookDeliveryListResponse body() {
+ return body;
+ }
+
+ /**
+ * The {@code data} property.
+ *
+ * @return the value, never null
+ */
+ public List data() {
+ return body.data();
+ }
+
+ /**
+ * The {@code pagination_meta} property.
+ *
+ * @return the value, never null
+ */
+ public PaginationResponse paginationMeta() {
+ return body.paginationMeta();
+ }
+
+ @Override
+ public String toString() {
+ return "WebhookEndpointsEndpointsListDeliveriesPage{body="
+ + body
+ + ", hasNextPage="
+ + hasNextPage()
+ + "}";
+ }
+}
diff --git a/src/main/java/com/meteroid/models/CreateWebhookEndpointRequest.java b/src/main/java/com/meteroid/models/CreateWebhookEndpointRequest.java
new file mode 100644
index 0000000..176c733
--- /dev/null
+++ b/src/main/java/com/meteroid/models/CreateWebhookEndpointRequest.java
@@ -0,0 +1,352 @@
+// This file is @generated
+package com.meteroid.models;
+
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonAutoDetect;
+import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility;
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.meteroid.internal.JsonField;
+import com.meteroid.internal.Utils;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Optional;
+
+/** Immutable: build one with {@link #builder()}, change a copy with {@link #toBuilder()}. */
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@JsonIgnoreProperties(ignoreUnknown = true)
+@JsonAutoDetect(
+ getterVisibility = Visibility.NONE,
+ isGetterVisibility = Visibility.NONE,
+ setterVisibility = Visibility.NONE)
+public final class CreateWebhookEndpointRequest {
+ @JsonProperty("description")
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ private JsonField description = JsonField.missing();
+
+ @JsonProperty("event_types")
+ private List eventTypes;
+
+ @JsonProperty("headers")
+ private List headers;
+
+ @JsonProperty("rate_limit_per_sec")
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ private JsonField rateLimitPerSec = JsonField.missing();
+
+ @JsonProperty("url")
+ private String url;
+
+ private final Map additionalProperties = new LinkedHashMap<>();
+
+ private CreateWebhookEndpointRequest() {}
+
+ private CreateWebhookEndpointRequest(Builder builder) {
+ this.description = builder.description;
+ this.eventTypes = Utils.copyList(builder.eventTypes);
+ this.headers = Utils.copyList(builder.headers);
+ this.rateLimitPerSec = builder.rateLimitPerSec;
+ this.url = builder.url;
+ this.additionalProperties.putAll(builder.additionalProperties);
+ }
+
+ /**
+ * A builder of {@code CreateWebhookEndpointRequest}.
+ *
+ * @return a new builder
+ */
+ public static Builder builder() {
+ return new Builder();
+ }
+
+ /**
+ * A builder starting from this value.
+ *
+ * @return a new builder
+ */
+ public Builder toBuilder() {
+ Builder builder = new Builder();
+ builder.description = description;
+ builder.eventTypes = Utils.mutableList(eventTypes);
+ builder.headers = Utils.mutableList(headers);
+ builder.rateLimitPerSec = rateLimitPerSec;
+ builder.url = url;
+ builder.additionalProperties.putAll(additionalProperties);
+ return builder;
+ }
+
+ /**
+ * The {@code description} property.
+ *
+ * @return the value, empty when unset or null
+ */
+ public Optional description() {
+ return description.asOptional();
+ }
+
+ /**
+ * Event types to subscribe to. Omit or leave empty to receive every event type.
+ *
+ * @return the value, empty when unset
+ */
+ public Optional> eventTypes() {
+ return Optional.ofNullable(eventTypes);
+ }
+
+ /**
+ * Custom headers sent with every delivery.
+ *
+ * @return the value, empty when unset
+ */
+ public Optional> headers() {
+ return Optional.ofNullable(headers);
+ }
+
+ /**
+ * Deliveries started per second, at most (1 to 1000).
+ *
+ * @return the value, empty when unset or null
+ */
+ public Optional rateLimitPerSec() {
+ return rateLimitPerSec.asOptional();
+ }
+
+ /**
+ * HTTPS destination. Private and loopback addresses are rejected unless the instance is
+ * configured to allow them.
+ *
+ * @return the value, never null
+ */
+ public String url() {
+ return Utils.required(url, "url");
+ }
+
+ /**
+ * Properties this version of the SDK does not know, kept as received and sent back.
+ *
+ * @return the properties by name, unmodifiable
+ */
+ public Map additionalProperties() {
+ return Collections.unmodifiableMap(additionalProperties);
+ }
+
+ @JsonAnyGetter
+ private Map anyProperties() {
+ return additionalProperties;
+ }
+
+ @JsonAnySetter
+ private void putAnyProperty(String name, JsonNode value) {
+ additionalProperties.put(name, value);
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ CreateWebhookEndpointRequest that = (CreateWebhookEndpointRequest) o;
+ return Objects.equals(description, that.description)
+ && Objects.equals(eventTypes, that.eventTypes)
+ && Objects.equals(headers, that.headers)
+ && Objects.equals(rateLimitPerSec, that.rateLimitPerSec)
+ && Objects.equals(url, that.url)
+ && Objects.equals(additionalProperties, that.additionalProperties);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(
+ description, eventTypes, headers, rateLimitPerSec, url, additionalProperties);
+ }
+
+ @Override
+ public String toString() {
+ return "CreateWebhookEndpointRequest{"
+ + "description="
+ + description
+ + ", eventTypes="
+ + eventTypes
+ + ", headers="
+ + headers
+ + ", rateLimitPerSec="
+ + rateLimitPerSec
+ + ", url="
+ + url
+ + ", additionalProperties="
+ + additionalProperties
+ + "}";
+ }
+
+ /** Builds {@link CreateWebhookEndpointRequest}. */
+ public static final class Builder {
+ private JsonField description = JsonField.missing();
+ private List eventTypes;
+ private List headers;
+ private JsonField rateLimitPerSec = JsonField.missing();
+ private String url;
+ private final Map additionalProperties = new LinkedHashMap<>();
+
+ private Builder() {}
+
+ /**
+ * The {@code description} property.
+ *
+ * @param description the value, null to send an explicit {@code null}
+ * @return this builder
+ */
+ public Builder description(String description) {
+ this.description = JsonField.ofNullable(description);
+ return this;
+ }
+
+ /**
+ * Event types to subscribe to. Omit or leave empty to receive every event type.
+ *
+ * @param eventTypes the value
+ * @return this builder
+ */
+ public Builder eventTypes(List eventTypes) {
+ this.eventTypes = Utils.mutableList(eventTypes);
+ return this;
+ }
+
+ /**
+ * Adds an item to {@code event_types}.
+ *
+ * @param item the item
+ * @return this builder
+ */
+ public Builder addEventTypesItem(String item) {
+ if (this.eventTypes == null) {
+ this.eventTypes = new ArrayList<>();
+ }
+ this.eventTypes.add(item);
+ return this;
+ }
+
+ /**
+ * Custom headers sent with every delivery.
+ *
+ * @param headers the value
+ * @return this builder
+ */
+ public Builder headers(List headers) {
+ this.headers = Utils.mutableList(headers);
+ return this;
+ }
+
+ /**
+ * Adds an item to {@code headers}.
+ *
+ * @param item the item
+ * @return this builder
+ */
+ public Builder addHeadersItem(WebhookHeaderInput item) {
+ if (this.headers == null) {
+ this.headers = new ArrayList<>();
+ }
+ this.headers.add(item);
+ return this;
+ }
+
+ /**
+ * Deliveries started per second, at most (1 to 1000).
+ *
+ * @param rateLimitPerSec the value, null to send an explicit {@code null}
+ * @return this builder
+ */
+ public Builder rateLimitPerSec(Integer rateLimitPerSec) {
+ this.rateLimitPerSec = JsonField.ofNullable(rateLimitPerSec);
+ return this;
+ }
+
+ /**
+ * HTTPS destination. Private and loopback addresses are rejected unless the instance is
+ * configured to allow them.
+ *
+ * @param url the value
+ * @return this builder
+ */
+ public Builder url(String url) {
+ this.url = url;
+ return this;
+ }
+
+ /**
+ * A property the SDK does not know, sent along.
+ *
+ * @param name the property name
+ * @param value the JSON value
+ * @return this builder
+ */
+ public Builder putAdditionalProperty(String name, JsonNode value) {
+ additionalProperties.put(name, value);
+ return this;
+ }
+
+ /**
+ * Properties the SDK does not know, sent along.
+ *
+ * @param additionalProperties the properties by name
+ * @return this builder
+ */
+ public Builder putAllAdditionalProperties(Map additionalProperties) {
+ this.additionalProperties.putAll(additionalProperties);
+ return this;
+ }
+
+ /**
+ * Leaves out a property the SDK does not know.
+ *
+ * @param name the property name
+ * @return this builder
+ */
+ public Builder removeAdditionalProperty(String name) {
+ additionalProperties.remove(name);
+ return this;
+ }
+
+ /**
+ * The {@code CreateWebhookEndpointRequest}.
+ *
+ * @return the immutable value
+ * @throws IllegalStateException when a required property is not set
+ */
+ public CreateWebhookEndpointRequest build() {
+ Utils.checkRequired(url, "url");
+ return new CreateWebhookEndpointRequest(this);
+ }
+ }
+
+ /**
+ * Parse {@code json} as {@code CreateWebhookEndpointRequest}.
+ *
+ * @param json the JSON text
+ * @return the value
+ * @throws com.meteroid.exceptions.InvalidDataException if it is not valid JSON of this shape
+ */
+ public static CreateWebhookEndpointRequest fromJson(String json) {
+ return Utils.parse(json, CreateWebhookEndpointRequest.class);
+ }
+
+ /**
+ * This value as JSON.
+ *
+ * @return the JSON text
+ */
+ public String toJson() {
+ return Utils.json(this);
+ }
+}
diff --git a/src/main/java/com/meteroid/models/CreatedWebhookEndpoint.java b/src/main/java/com/meteroid/models/CreatedWebhookEndpoint.java
new file mode 100644
index 0000000..17d874e
--- /dev/null
+++ b/src/main/java/com/meteroid/models/CreatedWebhookEndpoint.java
@@ -0,0 +1,227 @@
+// This file is @generated
+package com.meteroid.models;
+
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonAutoDetect;
+import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility;
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.meteroid.internal.Unions;
+import com.meteroid.internal.Utils;
+
+import java.util.Collections;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.Objects;
+
+/**
+ * The signing secret is returned in full here and never again outside the reveal and rotate
+ * endpoints.
+ *
+ *
Immutable: build one with {@link #builder()}, change a copy with {@link #toBuilder()}.
+ */
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@JsonIgnoreProperties(ignoreUnknown = true)
+@JsonAutoDetect(
+ getterVisibility = Visibility.NONE,
+ isGetterVisibility = Visibility.NONE,
+ setterVisibility = Visibility.NONE)
+public final class CreatedWebhookEndpoint {
+ @JsonProperty("secret")
+ private String secret;
+
+ private final Map additionalProperties = new LinkedHashMap<>();
+
+ private CreatedWebhookEndpoint() {}
+
+ private CreatedWebhookEndpoint(Builder builder) {
+ this.secret = builder.secret;
+ this.additionalProperties.putAll(builder.additionalProperties);
+ }
+
+ /**
+ * A builder of {@code CreatedWebhookEndpoint}.
+ *
+ * @return a new builder
+ */
+ public static Builder builder() {
+ return new Builder();
+ }
+
+ /**
+ * A builder starting from this value.
+ *
+ * @return a new builder
+ */
+ public Builder toBuilder() {
+ Builder builder = new Builder();
+ builder.secret = secret;
+ builder.additionalProperties.putAll(additionalProperties);
+ return builder;
+ }
+
+ /**
+ * The properties of {@link WebhookEndpoint}, which this schema extends.
+ *
+ * @return the properties of this part
+ */
+ public WebhookEndpoint webhookEndpoint() {
+ return Unions.convert(additionalProperties, WebhookEndpoint.class);
+ }
+
+ /**
+ * The {@code secret} property.
+ *
+ * @return the value, never null
+ */
+ public String secret() {
+ return Utils.required(secret, "secret");
+ }
+
+ /**
+ * Properties this version of the SDK does not know, kept as received and sent back.
+ *
+ * @return the properties by name, unmodifiable
+ */
+ public Map additionalProperties() {
+ Map unknown = new LinkedHashMap<>(additionalProperties);
+ unknown.keySet().retainAll(webhookEndpoint().additionalProperties().keySet());
+ return Collections.unmodifiableMap(unknown);
+ }
+
+ @JsonAnyGetter
+ private Map anyProperties() {
+ return additionalProperties;
+ }
+
+ @JsonAnySetter
+ private void putAnyProperty(String name, JsonNode value) {
+ additionalProperties.put(name, value);
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ CreatedWebhookEndpoint that = (CreatedWebhookEndpoint) o;
+ return Objects.equals(secret, that.secret)
+ && Objects.equals(additionalProperties, that.additionalProperties);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(secret, additionalProperties);
+ }
+
+ @Override
+ public String toString() {
+ return "CreatedWebhookEndpoint{"
+ + "secret="
+ + secret
+ + ", additionalProperties="
+ + additionalProperties
+ + "}";
+ }
+
+ /** Builds {@link CreatedWebhookEndpoint}. */
+ public static final class Builder {
+ private String secret;
+ private final Map additionalProperties = new LinkedHashMap<>();
+
+ private Builder() {}
+
+ /**
+ * Sets the properties of {@link WebhookEndpoint}, which this schema extends.
+ *
+ * @param webhookEndpoint the properties
+ * @return this builder
+ */
+ public Builder webhookEndpoint(WebhookEndpoint webhookEndpoint) {
+ additionalProperties.putAll(Utils.properties(webhookEndpoint));
+ return this;
+ }
+
+ /**
+ * The {@code secret} property.
+ *
+ * @param secret the value
+ * @return this builder
+ */
+ public Builder secret(String secret) {
+ this.secret = secret;
+ return this;
+ }
+
+ /**
+ * A property the SDK does not know, sent along.
+ *
+ * @param name the property name
+ * @param value the JSON value
+ * @return this builder
+ */
+ public Builder putAdditionalProperty(String name, JsonNode value) {
+ additionalProperties.put(name, value);
+ return this;
+ }
+
+ /**
+ * Properties the SDK does not know, sent along.
+ *
+ * @param additionalProperties the properties by name
+ * @return this builder
+ */
+ public Builder putAllAdditionalProperties(Map additionalProperties) {
+ this.additionalProperties.putAll(additionalProperties);
+ return this;
+ }
+
+ /**
+ * Leaves out a property the SDK does not know.
+ *
+ * @param name the property name
+ * @return this builder
+ */
+ public Builder removeAdditionalProperty(String name) {
+ additionalProperties.remove(name);
+ return this;
+ }
+
+ /**
+ * The {@code CreatedWebhookEndpoint}.
+ *
+ * @return the immutable value
+ * @throws IllegalStateException when a required property is not set
+ */
+ public CreatedWebhookEndpoint build() {
+ Utils.checkRequired(secret, "secret");
+ return new CreatedWebhookEndpoint(this);
+ }
+ }
+
+ /**
+ * Parse {@code json} as {@code CreatedWebhookEndpoint}.
+ *
+ * @param json the JSON text
+ * @return the value
+ * @throws com.meteroid.exceptions.InvalidDataException if it is not valid JSON of this shape
+ */
+ public static CreatedWebhookEndpoint fromJson(String json) {
+ return Utils.parse(json, CreatedWebhookEndpoint.class);
+ }
+
+ /**
+ * This value as JSON.
+ *
+ * @return the JSON text
+ */
+ public String toJson() {
+ return Utils.json(this);
+ }
+}
diff --git a/src/main/java/com/meteroid/models/CustomerCreateRequest.java b/src/main/java/com/meteroid/models/CustomerCreateRequest.java
index 47b9b8f..8e09069 100644
--- a/src/main/java/com/meteroid/models/CustomerCreateRequest.java
+++ b/src/main/java/com/meteroid/models/CustomerCreateRequest.java
@@ -250,10 +250,10 @@ public Optional