+
+**mode:** `Optional` — Filter results by processing mode. Returns only jobs that ran in the specified mode.
+
@@ -586,7 +594,9 @@ client.jobs().getJobResults(
-Returns a completed job's result records as a CSV download. One row per record, with enrichment fields as columns, citations as a JSON column, and connected entities split into `event_associated_entities` and `mention_entities` JSON columns.
+Returns a completed job's result records as a CSV download. One row per record, with enrichment fields as columns and citations as a JSON column.
+
+If the job used connected entity datasets, connected entities are split into `event_associated_entities` and `mention_entities` JSON columns. When no entity dataset was used, those two columns are omitted from the export entirely.
-Returns the most recent run's records as a CSV download. One row per record, with enrichment fields as columns, citations as a JSON column, and connected entities split into `event_associated_entities` and `mention_entities` JSON columns.
+Returns the most recent run's records as a CSV download. One row per record, with enrichment fields as columns and citations as a JSON column.
+
+If the monitor's reference job used connected entity datasets, connected entities are split into `event_associated_entities` and `mention_entities` JSON columns. When no entity dataset was used, those two columns are omitted from the export entirely.
Creates a new webhook endpoint for the organization.
+
+Optionally pass `project_id` to attach the webhook to a project in the same request.
@@ -1623,6 +1637,7 @@ client.webhooks().createWebhook(
.url("https://hooks.slack.com/services/T000/B000/xxx")
.type(WebhookType.SLACK)
.deliveryMode(DeliveryMode.FULL)
+ .projectId("60a85db4-78ec-4b78-876a-bc7d9cdadd04")
.build()
);
```
@@ -1720,6 +1735,21 @@ Authentication forwarded with each delivery. Supported types:
**formatterConfig:** `Optional` — Custom payload formatter. Required when `type` is `custom`.
+
+
+
+
+
+
+**projectId:** `Optional`
+
+Optional project to attach this webhook to at creation time. Equivalent
+to creating the webhook and then calling
+[`POST /catchAll/projects/{project_id}/resources`](https://www.newscatcherapi.com/docs/web-search-api/api-reference/projects/add-resource)
+with `resource_type: webhook`.
+
+The project must belong to your organization.
+
-Deletes a project. By default, assigned resources are unassigned but not deleted.
+Deletes a project. By default, assigned resources are unassigned but not deleted.
+
+Webhooks are an exception: they are never deleted by this operation, even when `delete_resources` is `true`. Any attached webhook is detached from the project and continues to exist and deliver, because the same webhook may be attached to other projects.
-**deleteResources:** `Optional` — If true, permanently deletes all resources (jobs, monitors, datasets) assigned to the project. If false, the project is deleted and its resources are unassigned but not deleted.
+**deleteResources:** `Optional`
+
+If true, permanently deletes all resources (jobs, monitors, datasets, monitor groups) assigned to the project. If false, the project is deleted and its resources are unassigned but not deleted.
+
+Webhooks are never deleted by either setting — they are only detached from the project.
@@ -4345,7 +4381,7 @@ client.projects().updateProject(
Returns resource counts for a project, grouped by type and status.
-For `jobs` and `monitors`, counts are broken down by status (for example, `completed`, `failed`). For `datasets` and `monitor_groups`, only a `total` count is returned.
+For `jobs` and `monitors`, counts are broken down by status (for example, `completed`, `failed`). For `datasets`, `monitor_groups`, and `webhooks`, only a `total` count is returned.
diff --git a/src/main/java/com/newscatcher/catchall/AsyncCatchAllApiBuilder.java b/src/main/java/com/newscatcher/catchall/AsyncCatchAllApiBuilder.java
index e73e7ea..32f76d2 100644
--- a/src/main/java/com/newscatcher/catchall/AsyncCatchAllApiBuilder.java
+++ b/src/main/java/com/newscatcher/catchall/AsyncCatchAllApiBuilder.java
@@ -16,6 +16,12 @@ public class AsyncCatchAllApiBuilder {
private Optional maxRetries = Optional.empty();
+ private Optional initialRetryDelayMillis = Optional.empty();
+
+ private Optional maxRetryDelayMillis = Optional.empty();
+
+ private Optional retryJitterFactor = Optional.empty();
+
private final Map customHeaders = new HashMap<>();
private String apiKey = null;
@@ -60,6 +66,30 @@ public AsyncCatchAllApiBuilder maxRetries(int maxRetries) {
return this;
}
+ /**
+ * Sets the initial delay (in milliseconds) used for exponential backoff between retries. Defaults to 1000 milliseconds.
+ */
+ public AsyncCatchAllApiBuilder initialRetryDelayMillis(long initialRetryDelayMillis) {
+ this.initialRetryDelayMillis = Optional.of(initialRetryDelayMillis);
+ return this;
+ }
+
+ /**
+ * Sets the maximum delay (in milliseconds) between retries. Defaults to 60000 milliseconds.
+ */
+ public AsyncCatchAllApiBuilder maxRetryDelayMillis(long maxRetryDelayMillis) {
+ this.maxRetryDelayMillis = Optional.of(maxRetryDelayMillis);
+ return this;
+ }
+
+ /**
+ * Sets the jitter factor (between 0 and 1) applied to retry delays. Defaults to 0.2.
+ */
+ public AsyncCatchAllApiBuilder retryJitterFactor(double retryJitterFactor) {
+ this.retryJitterFactor = Optional.of(retryJitterFactor);
+ return this;
+ }
+
/**
* Sets the underlying OkHttp client
*/
@@ -130,7 +160,9 @@ protected void setEnvironment(ClientOptions.Builder builder) {
* }
*/
protected void setAuthentication(ClientOptions.Builder builder) {
- builder.addHeader("x-api-key", this.apiKey);
+ if (this.apiKey != null) {
+ builder.addHeader("x-api-key", this.apiKey);
+ }
}
/**
@@ -155,6 +187,15 @@ protected void setRetries(ClientOptions.Builder builder) {
if (this.maxRetries.isPresent()) {
builder.maxRetries(this.maxRetries.get());
}
+ if (this.initialRetryDelayMillis.isPresent()) {
+ builder.initialRetryDelayMillis(this.initialRetryDelayMillis.get());
+ }
+ if (this.maxRetryDelayMillis.isPresent()) {
+ builder.maxRetryDelayMillis(this.maxRetryDelayMillis.get());
+ }
+ if (this.retryJitterFactor.isPresent()) {
+ builder.retryJitterFactor(this.retryJitterFactor.get());
+ }
}
/**
diff --git a/src/main/java/com/newscatcher/catchall/CatchAllApiBuilder.java b/src/main/java/com/newscatcher/catchall/CatchAllApiBuilder.java
index b77b493..eae20b7 100644
--- a/src/main/java/com/newscatcher/catchall/CatchAllApiBuilder.java
+++ b/src/main/java/com/newscatcher/catchall/CatchAllApiBuilder.java
@@ -16,6 +16,12 @@ public class CatchAllApiBuilder {
private Optional maxRetries = Optional.empty();
+ private Optional initialRetryDelayMillis = Optional.empty();
+
+ private Optional maxRetryDelayMillis = Optional.empty();
+
+ private Optional retryJitterFactor = Optional.empty();
+
private final Map customHeaders = new HashMap<>();
private String apiKey = null;
@@ -60,6 +66,30 @@ public CatchAllApiBuilder maxRetries(int maxRetries) {
return this;
}
+ /**
+ * Sets the initial delay (in milliseconds) used for exponential backoff between retries. Defaults to 1000 milliseconds.
+ */
+ public CatchAllApiBuilder initialRetryDelayMillis(long initialRetryDelayMillis) {
+ this.initialRetryDelayMillis = Optional.of(initialRetryDelayMillis);
+ return this;
+ }
+
+ /**
+ * Sets the maximum delay (in milliseconds) between retries. Defaults to 60000 milliseconds.
+ */
+ public CatchAllApiBuilder maxRetryDelayMillis(long maxRetryDelayMillis) {
+ this.maxRetryDelayMillis = Optional.of(maxRetryDelayMillis);
+ return this;
+ }
+
+ /**
+ * Sets the jitter factor (between 0 and 1) applied to retry delays. Defaults to 0.2.
+ */
+ public CatchAllApiBuilder retryJitterFactor(double retryJitterFactor) {
+ this.retryJitterFactor = Optional.of(retryJitterFactor);
+ return this;
+ }
+
/**
* Sets the underlying OkHttp client
*/
@@ -130,7 +160,9 @@ protected void setEnvironment(ClientOptions.Builder builder) {
* }
*/
protected void setAuthentication(ClientOptions.Builder builder) {
- builder.addHeader("x-api-key", this.apiKey);
+ if (this.apiKey != null) {
+ builder.addHeader("x-api-key", this.apiKey);
+ }
}
/**
@@ -155,6 +187,15 @@ protected void setRetries(ClientOptions.Builder builder) {
if (this.maxRetries.isPresent()) {
builder.maxRetries(this.maxRetries.get());
}
+ if (this.initialRetryDelayMillis.isPresent()) {
+ builder.initialRetryDelayMillis(this.initialRetryDelayMillis.get());
+ }
+ if (this.maxRetryDelayMillis.isPresent()) {
+ builder.maxRetryDelayMillis(this.maxRetryDelayMillis.get());
+ }
+ if (this.retryJitterFactor.isPresent()) {
+ builder.retryJitterFactor(this.retryJitterFactor.get());
+ }
}
/**
diff --git a/src/main/java/com/newscatcher/catchall/core/ClientOptions.java b/src/main/java/com/newscatcher/catchall/core/ClientOptions.java
index 6e02a36..7c5b4e3 100644
--- a/src/main/java/com/newscatcher/catchall/core/ClientOptions.java
+++ b/src/main/java/com/newscatcher/catchall/core/ClientOptions.java
@@ -23,6 +23,12 @@ public final class ClientOptions {
private final int maxRetries;
+ private final Optional initialRetryDelayMillis;
+
+ private final Optional maxRetryDelayMillis;
+
+ private final Optional retryJitterFactor;
+
private final Optional logging;
private ClientOptions(
@@ -32,22 +38,28 @@ private ClientOptions(
OkHttpClient httpClient,
int timeout,
int maxRetries,
+ Optional initialRetryDelayMillis,
+ Optional maxRetryDelayMillis,
+ Optional retryJitterFactor,
Optional logging) {
this.environment = environment;
this.headers = new HashMap<>();
this.headers.putAll(headers);
this.headers.putAll(new HashMap() {
{
- put("User-Agent", "com.newscatcherapi:newscatcher-catchall-sdk/3.0.3");
+ put("User-Agent", "com.newscatcherapi.newscatcher-catchall-sdk/0.0.0-fern-placeholder");
put("X-Fern-Language", "JAVA");
- put("X-Fern-SDK-Name", "com.newscatcher.fern:api-sdk");
- put("X-Fern-SDK-Version", "3.0.3");
+ put("X-Fern-SDK-Name", "com.newscatcherapi:newscatcher-catchall-sdk");
+ put("X-Fern-SDK-Version", "0.0.0-fern-placeholder");
}
});
this.headerSuppliers = headerSuppliers;
this.httpClient = httpClient;
this.timeout = timeout;
this.maxRetries = maxRetries;
+ this.initialRetryDelayMillis = initialRetryDelayMillis;
+ this.maxRetryDelayMillis = maxRetryDelayMillis;
+ this.retryJitterFactor = retryJitterFactor;
this.logging = logging;
}
@@ -94,6 +106,18 @@ public int maxRetries() {
return this.maxRetries;
}
+ public Optional initialRetryDelayMillis() {
+ return this.initialRetryDelayMillis;
+ }
+
+ public Optional maxRetryDelayMillis() {
+ return this.maxRetryDelayMillis;
+ }
+
+ public Optional retryJitterFactor() {
+ return this.retryJitterFactor;
+ }
+
public Optional logging() {
return this.logging;
}
@@ -111,6 +135,12 @@ public static class Builder {
private int maxRetries = 2;
+ private Optional initialRetryDelayMillis = Optional.empty();
+
+ private Optional maxRetryDelayMillis = Optional.empty();
+
+ private Optional retryJitterFactor = Optional.empty();
+
private Optional timeout = Optional.empty();
private OkHttpClient httpClient = null;
@@ -123,7 +153,9 @@ public Builder environment(Environment environment) {
}
public Builder addHeader(String key, String value) {
- this.headers.put(key, value);
+ if (value != null) {
+ this.headers.put(key, value);
+ }
return this;
}
@@ -156,6 +188,30 @@ public Builder maxRetries(int maxRetries) {
return this;
}
+ /**
+ * Override the initial delay (in milliseconds) used for exponential backoff between retries. Defaults to 1000 milliseconds.
+ */
+ public Builder initialRetryDelayMillis(long initialRetryDelayMillis) {
+ this.initialRetryDelayMillis = Optional.of(initialRetryDelayMillis);
+ return this;
+ }
+
+ /**
+ * Override the maximum delay (in milliseconds) between retries. Defaults to 60000 milliseconds.
+ */
+ public Builder maxRetryDelayMillis(long maxRetryDelayMillis) {
+ this.maxRetryDelayMillis = Optional.of(maxRetryDelayMillis);
+ return this;
+ }
+
+ /**
+ * Override the jitter factor (between 0 and 1) applied to retry delays. Defaults to 0.2.
+ */
+ public Builder retryJitterFactor(double retryJitterFactor) {
+ this.retryJitterFactor = Optional.of(retryJitterFactor);
+ return this;
+ }
+
public Builder httpClient(OkHttpClient httpClient) {
this.httpClient = httpClient;
return this;
@@ -185,11 +241,16 @@ public ClientOptions build() {
.connectTimeout(0, TimeUnit.SECONDS)
.writeTimeout(0, TimeUnit.SECONDS)
.readTimeout(0, TimeUnit.SECONDS)
- .addInterceptor(new RetryInterceptor(this.maxRetries));
+ .addInterceptor(new RetryInterceptor(
+ this.maxRetries,
+ this.initialRetryDelayMillis,
+ this.maxRetryDelayMillis,
+ this.retryJitterFactor));
}
Logger logger = Logger.from(this.logging);
httpClientBuilder.addInterceptor(new LoggingInterceptor(logger));
+ httpClientBuilder.addInterceptor(new ResponseDecompressionInterceptor());
this.httpClient = httpClientBuilder.build();
this.timeout = Optional.of(httpClient.callTimeoutMillis() / 1000);
@@ -201,6 +262,9 @@ public ClientOptions build() {
httpClient,
this.timeout.get(),
this.maxRetries,
+ this.initialRetryDelayMillis,
+ this.maxRetryDelayMillis,
+ this.retryJitterFactor,
this.logging);
}
@@ -215,6 +279,9 @@ public static Builder from(ClientOptions clientOptions) {
builder.headers.putAll(clientOptions.headers);
builder.headerSuppliers.putAll(clientOptions.headerSuppliers);
builder.maxRetries = clientOptions.maxRetries();
+ builder.initialRetryDelayMillis = clientOptions.initialRetryDelayMillis();
+ builder.maxRetryDelayMillis = clientOptions.maxRetryDelayMillis();
+ builder.retryJitterFactor = clientOptions.retryJitterFactor();
builder.logging = clientOptions.logging();
return builder;
}
diff --git a/src/main/java/com/newscatcher/catchall/core/ConsoleLogger.java b/src/main/java/com/newscatcher/catchall/core/ConsoleLogger.java
index 297f3f4..8d7507e 100644
--- a/src/main/java/com/newscatcher/catchall/core/ConsoleLogger.java
+++ b/src/main/java/com/newscatcher/catchall/core/ConsoleLogger.java
@@ -23,6 +23,7 @@ public String format(java.util.logging.LogRecord record) {
return record.getLevel() + " - " + record.getMessage() + System.lineSeparator();
}
});
+ handler.setLevel(Level.ALL);
logger.addHandler(handler);
logger.setUseParentHandlers(false);
logger.setLevel(Level.ALL);
diff --git a/src/main/java/com/newscatcher/catchall/core/ResponseDecompressionInterceptor.java b/src/main/java/com/newscatcher/catchall/core/ResponseDecompressionInterceptor.java
new file mode 100644
index 0000000..f9cd2f8
--- /dev/null
+++ b/src/main/java/com/newscatcher/catchall/core/ResponseDecompressionInterceptor.java
@@ -0,0 +1,56 @@
+/**
+ * This file was auto-generated by Fern from our API Definition.
+ */
+package com.newscatcher.catchall.core;
+
+import java.io.IOException;
+import java.util.zip.Inflater;
+import okhttp3.Interceptor;
+import okhttp3.Response;
+import okhttp3.ResponseBody;
+import okio.GzipSource;
+import okio.InflaterSource;
+import okio.Okio;
+import okio.Source;
+
+/**
+ * Decompresses gzip and deflate encoded response bodies. OkHttp only performs
+ * transparent decompression when it adds the Accept-Encoding header itself, so
+ * responses to requests with an explicitly set Accept-Encoding header would
+ * otherwise be returned as raw compressed bytes.
+ */
+public class ResponseDecompressionInterceptor implements Interceptor {
+
+ @Override
+ public Response intercept(Chain chain) throws IOException {
+ return decompress(chain.proceed(chain.request()));
+ }
+
+ private Response decompress(Response response) {
+ ResponseBody body = response.body();
+ if (body == null) {
+ return response;
+ }
+ String encoding = response.header("Content-Encoding");
+ if (encoding == null) {
+ return response;
+ }
+ Source decompressedSource;
+ if (encoding.equalsIgnoreCase("gzip") || encoding.equalsIgnoreCase("x-gzip")) {
+ decompressedSource = new GzipSource(body.source());
+ } else if (encoding.equalsIgnoreCase("deflate")) {
+ decompressedSource = new InflaterSource(body.source(), new Inflater());
+ } else {
+ return response;
+ }
+ ResponseBody decompressedBody = ResponseBody.create(body.contentType(), -1L, Okio.buffer(decompressedSource));
+ return response.newBuilder()
+ .headers(response.headers()
+ .newBuilder()
+ .removeAll("Content-Encoding")
+ .removeAll("Content-Length")
+ .build())
+ .body(decompressedBody)
+ .build();
+ }
+}
diff --git a/src/main/java/com/newscatcher/catchall/core/RetryInterceptor.java b/src/main/java/com/newscatcher/catchall/core/RetryInterceptor.java
index f6a389f..966ddca 100644
--- a/src/main/java/com/newscatcher/catchall/core/RetryInterceptor.java
+++ b/src/main/java/com/newscatcher/catchall/core/RetryInterceptor.java
@@ -16,15 +16,44 @@
public class RetryInterceptor implements Interceptor {
- private static final Duration INITIAL_RETRY_DELAY = Duration.ofMillis(1000);
- private static final Duration MAX_RETRY_DELAY = Duration.ofMillis(60000);
- private static final double JITTER_FACTOR = 0.2;
+ private static final Duration DEFAULT_INITIAL_RETRY_DELAY = Duration.ofMillis(1000);
+ private static final Duration DEFAULT_MAX_RETRY_DELAY = Duration.ofMillis(60000);
+ private static final double DEFAULT_JITTER_FACTOR = 0.2;
private final int maxRetries;
+ private final Duration initialRetryDelay;
+ private final Duration maxRetryDelay;
+ private final double jitterFactor;
private final Random random = new Random();
public RetryInterceptor(int maxRetries) {
+ this(maxRetries, Optional.empty(), Optional.empty(), Optional.empty());
+ }
+
+ public RetryInterceptor(
+ int maxRetries,
+ Optional initialRetryDelayMillis,
+ Optional maxRetryDelayMillis,
+ Optional jitterFactor) {
+ initialRetryDelayMillis.ifPresent(delay -> {
+ if (delay < 0) {
+ throw new IllegalArgumentException("initialRetryDelayMillis must be non-negative");
+ }
+ });
+ maxRetryDelayMillis.ifPresent(delay -> {
+ if (delay < 0) {
+ throw new IllegalArgumentException("maxRetryDelayMillis must be non-negative");
+ }
+ });
+ jitterFactor.ifPresent(factor -> {
+ if (factor < 0 || factor > 1) {
+ throw new IllegalArgumentException("jitterFactor must be between 0 and 1");
+ }
+ });
this.maxRetries = maxRetries;
+ this.initialRetryDelay = initialRetryDelayMillis.map(Duration::ofMillis).orElse(DEFAULT_INITIAL_RETRY_DELAY);
+ this.maxRetryDelay = maxRetryDelayMillis.map(Duration::ofMillis).orElse(DEFAULT_MAX_RETRY_DELAY);
+ this.jitterFactor = jitterFactor.orElse(DEFAULT_JITTER_FACTOR);
}
@Override
@@ -78,7 +107,7 @@ private Duration getRetryDelayFromHeaders(Response response, int retryAttempt) {
Optional secondsDelay = tryParseLong(retryAfter)
.map(seconds -> seconds * 1000)
.filter(delayMs -> delayMs > 0)
- .map(delayMs -> Math.min(delayMs, MAX_RETRY_DELAY.toMillis()))
+ .map(delayMs -> Math.min(delayMs, maxRetryDelay.toMillis()))
.map(Duration::ofMillis);
if (secondsDelay.isPresent()) {
return secondsDelay.get();
@@ -88,7 +117,7 @@ private Duration getRetryDelayFromHeaders(Response response, int retryAttempt) {
Optional dateDelay = tryParseHttpDate(retryAfter)
.map(resetTime -> resetTime.toInstant().toEpochMilli() - System.currentTimeMillis())
.filter(delayMs -> delayMs > 0)
- .map(delayMs -> Math.min(delayMs, MAX_RETRY_DELAY.toMillis()))
+ .map(delayMs -> Math.min(delayMs, maxRetryDelay.toMillis()))
.map(Duration::ofMillis);
if (dateDelay.isPresent()) {
return dateDelay.get();
@@ -102,7 +131,7 @@ private Duration getRetryDelayFromHeaders(Response response, int retryAttempt) {
Optional rateLimitDelay = tryParseLong(rateLimitReset)
.map(resetTimeSeconds -> (resetTimeSeconds * 1000) - System.currentTimeMillis())
.filter(delayMs -> delayMs > 0)
- .map(delayMs -> Math.min(delayMs, MAX_RETRY_DELAY.toMillis()))
+ .map(delayMs -> Math.min(delayMs, maxRetryDelay.toMillis()))
.map(this::addPositiveJitter)
.map(Duration::ofMillis);
if (rateLimitDelay.isPresent()) {
@@ -111,8 +140,15 @@ private Duration getRetryDelayFromHeaders(Response response, int retryAttempt) {
}
// Fall back to exponential backoff, with symmetric jitter
- long baseDelay = INITIAL_RETRY_DELAY.toMillis() * (1L << retryAttempt); // 2^retryAttempt
- long cappedDelay = Math.min(baseDelay, MAX_RETRY_DELAY.toMillis());
+ long initialDelayMillis = initialRetryDelay.toMillis();
+ long maxDelayMillis = maxRetryDelay.toMillis();
+ long cappedDelay;
+ if (retryAttempt >= Long.SIZE - 1 || initialDelayMillis > (maxDelayMillis >> retryAttempt)) {
+ // initialDelayMillis * 2^retryAttempt would exceed maxDelayMillis (or overflow)
+ cappedDelay = maxDelayMillis;
+ } else {
+ cappedDelay = Math.min(initialDelayMillis << retryAttempt, maxDelayMillis); // 2^retryAttempt
+ }
return Duration.ofMillis(addSymmetricJitter(cappedDelay));
}
@@ -149,7 +185,7 @@ private Optional tryParseHttpDate(String value) {
* Used for X-RateLimit-Reset header delays.
*/
private long addPositiveJitter(long delayMs) {
- double jitterMultiplier = 1.0 + (random.nextDouble() * JITTER_FACTOR);
+ double jitterMultiplier = 1.0 + (random.nextDouble() * jitterFactor);
return (long) (delayMs * jitterMultiplier);
}
@@ -158,7 +194,7 @@ private long addPositiveJitter(long delayMs) {
* Used for exponential backoff delays.
*/
private long addSymmetricJitter(long delayMs) {
- double jitterMultiplier = 1.0 + ((random.nextDouble() - 0.5) * JITTER_FACTOR);
+ double jitterMultiplier = 1.0 + ((random.nextDouble() - 0.5) * jitterFactor);
return (long) (delayMs * jitterMultiplier);
}
diff --git a/src/main/java/com/newscatcher/catchall/resources/jobs/AsyncJobsClient.java b/src/main/java/com/newscatcher/catchall/resources/jobs/AsyncJobsClient.java
index d202da5..9174b48 100644
--- a/src/main/java/com/newscatcher/catchall/resources/jobs/AsyncJobsClient.java
+++ b/src/main/java/com/newscatcher/catchall/resources/jobs/AsyncJobsClient.java
@@ -175,28 +175,32 @@ public CompletableFuture getJobResults(
}
/**
- * Returns a completed job's result records as a CSV download. One row per record, with enrichment fields as columns, citations as a JSON column, and connected entities split into event_associated_entities and mention_entities JSON columns.
+ * Returns a completed job's result records as a CSV download. One row per record, with enrichment fields as columns and citations as a JSON column.
+ *
If the job used connected entity datasets, connected entities are split into event_associated_entities and mention_entities JSON columns. When no entity dataset was used, those two columns are omitted from the export entirely.
*/
public CompletableFuture getJobResultsCsv(String jobId) {
return this.rawClient.getJobResultsCsv(jobId).thenApply(response -> response.body());
}
/**
- * Returns a completed job's result records as a CSV download. One row per record, with enrichment fields as columns, citations as a JSON column, and connected entities split into event_associated_entities and mention_entities JSON columns.
+ * Returns a completed job's result records as a CSV download. One row per record, with enrichment fields as columns and citations as a JSON column.
+ *
If the job used connected entity datasets, connected entities are split into event_associated_entities and mention_entities JSON columns. When no entity dataset was used, those two columns are omitted from the export entirely.
*/
public CompletableFuture getJobResultsCsv(String jobId, RequestOptions requestOptions) {
return this.rawClient.getJobResultsCsv(jobId, requestOptions).thenApply(response -> response.body());
}
/**
- * Returns a completed job's result records as a CSV download. One row per record, with enrichment fields as columns, citations as a JSON column, and connected entities split into event_associated_entities and mention_entities JSON columns.
+ * Returns a completed job's result records as a CSV download. One row per record, with enrichment fields as columns and citations as a JSON column.
+ *
If the job used connected entity datasets, connected entities are split into event_associated_entities and mention_entities JSON columns. When no entity dataset was used, those two columns are omitted from the export entirely.
*/
public CompletableFuture getJobResultsCsv(String jobId, GetJobResultsCsvRequest request) {
return this.rawClient.getJobResultsCsv(jobId, request).thenApply(response -> response.body());
}
/**
- * Returns a completed job's result records as a CSV download. One row per record, with enrichment fields as columns, citations as a JSON column, and connected entities split into event_associated_entities and mention_entities JSON columns.
+ * Returns a completed job's result records as a CSV download. One row per record, with enrichment fields as columns and citations as a JSON column.
+ *
If the job used connected entity datasets, connected entities are split into event_associated_entities and mention_entities JSON columns. When no entity dataset was used, those two columns are omitted from the export entirely.
*/
public CompletableFuture getJobResultsCsv(
String jobId, GetJobResultsCsvRequest request, RequestOptions requestOptions) {
diff --git a/src/main/java/com/newscatcher/catchall/resources/jobs/AsyncRawJobsClient.java b/src/main/java/com/newscatcher/catchall/resources/jobs/AsyncRawJobsClient.java
index c9331bc..562ea4e 100644
--- a/src/main/java/com/newscatcher/catchall/resources/jobs/AsyncRawJobsClient.java
+++ b/src/main/java/com/newscatcher/catchall/resources/jobs/AsyncRawJobsClient.java
@@ -107,6 +107,10 @@ public CompletableFuture> getUs
QueryStringMapper.addQueryParameter(
httpUrl, "project_id", request.getProjectId().get(), false);
}
+ if (request.getMode().isPresent()) {
+ QueryStringMapper.addQueryParameter(
+ httpUrl, "mode", request.getMode().get(), false);
+ }
if (requestOptions != null) {
requestOptions.getQueryParameters().forEach((_key, _value) -> {
httpUrl.addQueryParameter(_key, _value);
@@ -685,14 +689,16 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) {
}
/**
- * Returns a completed job's result records as a CSV download. One row per record, with enrichment fields as columns, citations as a JSON column, and connected entities split into event_associated_entities and mention_entities JSON columns.
+ * Returns a completed job's result records as a CSV download. One row per record, with enrichment fields as columns and citations as a JSON column.
+ *
If the job used connected entity datasets, connected entities are split into event_associated_entities and mention_entities JSON columns. When no entity dataset was used, those two columns are omitted from the export entirely.
*/
public CompletableFuture> getJobResultsCsv(String jobId) {
return getJobResultsCsv(jobId, GetJobResultsCsvRequest.builder().build());
}
/**
- * Returns a completed job's result records as a CSV download. One row per record, with enrichment fields as columns, citations as a JSON column, and connected entities split into event_associated_entities and mention_entities JSON columns.
+ * Returns a completed job's result records as a CSV download. One row per record, with enrichment fields as columns and citations as a JSON column.
+ *
If the job used connected entity datasets, connected entities are split into event_associated_entities and mention_entities JSON columns. When no entity dataset was used, those two columns are omitted from the export entirely.
*/
public CompletableFuture> getJobResultsCsv(
String jobId, RequestOptions requestOptions) {
@@ -700,7 +706,8 @@ public CompletableFuture> getJobResultsCsv(
}
/**
- * Returns a completed job's result records as a CSV download. One row per record, with enrichment fields as columns, citations as a JSON column, and connected entities split into event_associated_entities and mention_entities JSON columns.
+ * Returns a completed job's result records as a CSV download. One row per record, with enrichment fields as columns and citations as a JSON column.
+ *
If the job used connected entity datasets, connected entities are split into event_associated_entities and mention_entities JSON columns. When no entity dataset was used, those two columns are omitted from the export entirely.
*/
public CompletableFuture> getJobResultsCsv(
String jobId, GetJobResultsCsvRequest request) {
@@ -708,7 +715,8 @@ public CompletableFuture> getJobResultsCsv(
}
/**
- * Returns a completed job's result records as a CSV download. One row per record, with enrichment fields as columns, citations as a JSON column, and connected entities split into event_associated_entities and mention_entities JSON columns.
+ * Returns a completed job's result records as a CSV download. One row per record, with enrichment fields as columns and citations as a JSON column.
+ *
If the job used connected entity datasets, connected entities are split into event_associated_entities and mention_entities JSON columns. When no entity dataset was used, those two columns are omitted from the export entirely.
*/
public CompletableFuture> getJobResultsCsv(
String jobId, GetJobResultsCsvRequest request, RequestOptions requestOptions) {
diff --git a/src/main/java/com/newscatcher/catchall/resources/jobs/JobsClient.java b/src/main/java/com/newscatcher/catchall/resources/jobs/JobsClient.java
index af2e8ec..9360421 100644
--- a/src/main/java/com/newscatcher/catchall/resources/jobs/JobsClient.java
+++ b/src/main/java/com/newscatcher/catchall/resources/jobs/JobsClient.java
@@ -169,28 +169,32 @@ public PullJobResponseDto getJobResults(String jobId, GetJobResultsRequest reque
}
/**
- * Returns a completed job's result records as a CSV download. One row per record, with enrichment fields as columns, citations as a JSON column, and connected entities split into event_associated_entities and mention_entities JSON columns.
+ * Returns a completed job's result records as a CSV download. One row per record, with enrichment fields as columns and citations as a JSON column.
+ *
If the job used connected entity datasets, connected entities are split into event_associated_entities and mention_entities JSON columns. When no entity dataset was used, those two columns are omitted from the export entirely.
*/
public String getJobResultsCsv(String jobId) {
return this.rawClient.getJobResultsCsv(jobId).body();
}
/**
- * Returns a completed job's result records as a CSV download. One row per record, with enrichment fields as columns, citations as a JSON column, and connected entities split into event_associated_entities and mention_entities JSON columns.
+ * Returns a completed job's result records as a CSV download. One row per record, with enrichment fields as columns and citations as a JSON column.
+ *
If the job used connected entity datasets, connected entities are split into event_associated_entities and mention_entities JSON columns. When no entity dataset was used, those two columns are omitted from the export entirely.
*/
public String getJobResultsCsv(String jobId, RequestOptions requestOptions) {
return this.rawClient.getJobResultsCsv(jobId, requestOptions).body();
}
/**
- * Returns a completed job's result records as a CSV download. One row per record, with enrichment fields as columns, citations as a JSON column, and connected entities split into event_associated_entities and mention_entities JSON columns.
+ * Returns a completed job's result records as a CSV download. One row per record, with enrichment fields as columns and citations as a JSON column.
+ *
If the job used connected entity datasets, connected entities are split into event_associated_entities and mention_entities JSON columns. When no entity dataset was used, those two columns are omitted from the export entirely.
*/
public String getJobResultsCsv(String jobId, GetJobResultsCsvRequest request) {
return this.rawClient.getJobResultsCsv(jobId, request).body();
}
/**
- * Returns a completed job's result records as a CSV download. One row per record, with enrichment fields as columns, citations as a JSON column, and connected entities split into event_associated_entities and mention_entities JSON columns.
+ * Returns a completed job's result records as a CSV download. One row per record, with enrichment fields as columns and citations as a JSON column.
+ *
If the job used connected entity datasets, connected entities are split into event_associated_entities and mention_entities JSON columns. When no entity dataset was used, those two columns are omitted from the export entirely.
*/
public String getJobResultsCsv(String jobId, GetJobResultsCsvRequest request, RequestOptions requestOptions) {
return this.rawClient.getJobResultsCsv(jobId, request, requestOptions).body();
diff --git a/src/main/java/com/newscatcher/catchall/resources/jobs/RawJobsClient.java b/src/main/java/com/newscatcher/catchall/resources/jobs/RawJobsClient.java
index 663dfc2..917c15f 100644
--- a/src/main/java/com/newscatcher/catchall/resources/jobs/RawJobsClient.java
+++ b/src/main/java/com/newscatcher/catchall/resources/jobs/RawJobsClient.java
@@ -102,6 +102,10 @@ public CatchAllApiHttpResponse getUserJobs(
QueryStringMapper.addQueryParameter(
httpUrl, "project_id", request.getProjectId().get(), false);
}
+ if (request.getMode().isPresent()) {
+ QueryStringMapper.addQueryParameter(
+ httpUrl, "mode", request.getMode().get(), false);
+ }
if (requestOptions != null) {
requestOptions.getQueryParameters().forEach((_key, _value) -> {
httpUrl.addQueryParameter(_key, _value);
@@ -564,28 +568,32 @@ public CatchAllApiHttpResponse getJobResults(
}
/**
- * Returns a completed job's result records as a CSV download. One row per record, with enrichment fields as columns, citations as a JSON column, and connected entities split into event_associated_entities and mention_entities JSON columns.
+ * Returns a completed job's result records as a CSV download. One row per record, with enrichment fields as columns and citations as a JSON column.
+ *
If the job used connected entity datasets, connected entities are split into event_associated_entities and mention_entities JSON columns. When no entity dataset was used, those two columns are omitted from the export entirely.
*/
public CatchAllApiHttpResponse getJobResultsCsv(String jobId) {
return getJobResultsCsv(jobId, GetJobResultsCsvRequest.builder().build());
}
/**
- * Returns a completed job's result records as a CSV download. One row per record, with enrichment fields as columns, citations as a JSON column, and connected entities split into event_associated_entities and mention_entities JSON columns.
+ * Returns a completed job's result records as a CSV download. One row per record, with enrichment fields as columns and citations as a JSON column.
+ *
If the job used connected entity datasets, connected entities are split into event_associated_entities and mention_entities JSON columns. When no entity dataset was used, those two columns are omitted from the export entirely.
*/
public CatchAllApiHttpResponse getJobResultsCsv(String jobId, RequestOptions requestOptions) {
return getJobResultsCsv(jobId, GetJobResultsCsvRequest.builder().build(), requestOptions);
}
/**
- * Returns a completed job's result records as a CSV download. One row per record, with enrichment fields as columns, citations as a JSON column, and connected entities split into event_associated_entities and mention_entities JSON columns.
+ * Returns a completed job's result records as a CSV download. One row per record, with enrichment fields as columns and citations as a JSON column.
+ *
If the job used connected entity datasets, connected entities are split into event_associated_entities and mention_entities JSON columns. When no entity dataset was used, those two columns are omitted from the export entirely.
*/
public CatchAllApiHttpResponse getJobResultsCsv(String jobId, GetJobResultsCsvRequest request) {
return getJobResultsCsv(jobId, request, null);
}
/**
- * Returns a completed job's result records as a CSV download. One row per record, with enrichment fields as columns, citations as a JSON column, and connected entities split into event_associated_entities and mention_entities JSON columns.
+ * Returns a completed job's result records as a CSV download. One row per record, with enrichment fields as columns and citations as a JSON column.
+ *
If the job used connected entity datasets, connected entities are split into event_associated_entities and mention_entities JSON columns. When no entity dataset was used, those two columns are omitted from the export entirely.
Filter results by processing mode. Returns only jobs that ran in the specified mode.
+ */
+ @JsonSetter(value = "mode", nulls = Nulls.SKIP)
+ public Builder mode(Optional mode) {
+ this.mode = mode;
+ return this;
+ }
+
+ public Builder mode(GetUserJobsRequestMode mode) {
+ this.mode = Optional.ofNullable(mode);
+ return this;
+ }
+
public GetUserJobsRequest build() {
- return new GetUserJobsRequest(page, pageSize, search, ownership, projectId, additionalProperties);
+ return new GetUserJobsRequest(page, pageSize, search, ownership, projectId, mode, additionalProperties);
}
public Builder additionalProperty(String key, Object value) {
diff --git a/src/main/java/com/newscatcher/catchall/resources/jobs/types/GetUserJobsRequestMode.java b/src/main/java/com/newscatcher/catchall/resources/jobs/types/GetUserJobsRequestMode.java
new file mode 100644
index 0000000..b0544d5
--- /dev/null
+++ b/src/main/java/com/newscatcher/catchall/resources/jobs/types/GetUserJobsRequestMode.java
@@ -0,0 +1,84 @@
+/**
+ * This file was auto-generated by Fern from our API Definition.
+ */
+package com.newscatcher.catchall.resources.jobs.types;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonValue;
+
+public final class GetUserJobsRequestMode {
+ public static final GetUserJobsRequestMode LITE = new GetUserJobsRequestMode(Value.LITE, "lite");
+
+ public static final GetUserJobsRequestMode BASE = new GetUserJobsRequestMode(Value.BASE, "base");
+
+ private final Value value;
+
+ private final String string;
+
+ GetUserJobsRequestMode(Value value, String string) {
+ this.value = value;
+ this.string = string;
+ }
+
+ public Value getEnumValue() {
+ return value;
+ }
+
+ @java.lang.Override
+ @JsonValue
+ public String toString() {
+ return this.string;
+ }
+
+ @java.lang.Override
+ public boolean equals(Object other) {
+ return (this == other)
+ || (other instanceof GetUserJobsRequestMode
+ && this.string.equals(((GetUserJobsRequestMode) other).string));
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ return this.string.hashCode();
+ }
+
+ public T visit(Visitor visitor) {
+ switch (value) {
+ case LITE:
+ return visitor.visitLite();
+ case BASE:
+ return visitor.visitBase();
+ case UNKNOWN:
+ default:
+ return visitor.visitUnknown(string);
+ }
+ }
+
+ @JsonCreator(mode = JsonCreator.Mode.DELEGATING)
+ public static GetUserJobsRequestMode valueOf(String value) {
+ switch (value) {
+ case "lite":
+ return LITE;
+ case "base":
+ return BASE;
+ default:
+ return new GetUserJobsRequestMode(Value.UNKNOWN, value);
+ }
+ }
+
+ public enum Value {
+ LITE,
+
+ BASE,
+
+ UNKNOWN
+ }
+
+ public interface Visitor {
+ T visitLite();
+
+ T visitBase();
+
+ T visitUnknown(String unknownType);
+ }
+}
diff --git a/src/main/java/com/newscatcher/catchall/resources/monitors/AsyncMonitorsClient.java b/src/main/java/com/newscatcher/catchall/resources/monitors/AsyncMonitorsClient.java
index 6db5d8f..3ecfa94 100644
--- a/src/main/java/com/newscatcher/catchall/resources/monitors/AsyncMonitorsClient.java
+++ b/src/main/java/com/newscatcher/catchall/resources/monitors/AsyncMonitorsClient.java
@@ -121,28 +121,32 @@ public CompletableFuture pullMonitorResults(
}
/**
- * Returns the most recent run's records as a CSV download. One row per record, with enrichment fields as columns, citations as a JSON column, and connected entities split into event_associated_entities and mention_entities JSON columns.
+ * Returns the most recent run's records as a CSV download. One row per record, with enrichment fields as columns and citations as a JSON column.
+ *
If the monitor's reference job used connected entity datasets, connected entities are split into event_associated_entities and mention_entities JSON columns. When no entity dataset was used, those two columns are omitted from the export entirely.
*/
public CompletableFuture pullMonitorResultsCsv(String monitorId) {
return this.rawClient.pullMonitorResultsCsv(monitorId).thenApply(response -> response.body());
}
/**
- * Returns the most recent run's records as a CSV download. One row per record, with enrichment fields as columns, citations as a JSON column, and connected entities split into event_associated_entities and mention_entities JSON columns.
+ * Returns the most recent run's records as a CSV download. One row per record, with enrichment fields as columns and citations as a JSON column.
+ *
If the monitor's reference job used connected entity datasets, connected entities are split into event_associated_entities and mention_entities JSON columns. When no entity dataset was used, those two columns are omitted from the export entirely.
*/
public CompletableFuture pullMonitorResultsCsv(String monitorId, RequestOptions requestOptions) {
return this.rawClient.pullMonitorResultsCsv(monitorId, requestOptions).thenApply(response -> response.body());
}
/**
- * Returns the most recent run's records as a CSV download. One row per record, with enrichment fields as columns, citations as a JSON column, and connected entities split into event_associated_entities and mention_entities JSON columns.
+ * Returns the most recent run's records as a CSV download. One row per record, with enrichment fields as columns and citations as a JSON column.
+ *
If the monitor's reference job used connected entity datasets, connected entities are split into event_associated_entities and mention_entities JSON columns. When no entity dataset was used, those two columns are omitted from the export entirely.
*/
public CompletableFuture pullMonitorResultsCsv(String monitorId, PullMonitorResultsCsvRequest request) {
return this.rawClient.pullMonitorResultsCsv(monitorId, request).thenApply(response -> response.body());
}
/**
- * Returns the most recent run's records as a CSV download. One row per record, with enrichment fields as columns, citations as a JSON column, and connected entities split into event_associated_entities and mention_entities JSON columns.
+ * Returns the most recent run's records as a CSV download. One row per record, with enrichment fields as columns and citations as a JSON column.
+ *
If the monitor's reference job used connected entity datasets, connected entities are split into event_associated_entities and mention_entities JSON columns. When no entity dataset was used, those two columns are omitted from the export entirely.
*/
public CompletableFuture pullMonitorResultsCsv(
String monitorId, PullMonitorResultsCsvRequest request, RequestOptions requestOptions) {
diff --git a/src/main/java/com/newscatcher/catchall/resources/monitors/AsyncRawMonitorsClient.java b/src/main/java/com/newscatcher/catchall/resources/monitors/AsyncRawMonitorsClient.java
index 7b7b368..4270db0 100644
--- a/src/main/java/com/newscatcher/catchall/resources/monitors/AsyncRawMonitorsClient.java
+++ b/src/main/java/com/newscatcher/catchall/resources/monitors/AsyncRawMonitorsClient.java
@@ -379,7 +379,8 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) {
}
/**
- * Returns the most recent run's records as a CSV download. One row per record, with enrichment fields as columns, citations as a JSON column, and connected entities split into event_associated_entities and mention_entities JSON columns.
+ * Returns the most recent run's records as a CSV download. One row per record, with enrichment fields as columns and citations as a JSON column.
+ *
If the monitor's reference job used connected entity datasets, connected entities are split into event_associated_entities and mention_entities JSON columns. When no entity dataset was used, those two columns are omitted from the export entirely.
*/
public CompletableFuture> pullMonitorResultsCsv(String monitorId) {
return pullMonitorResultsCsv(
@@ -387,7 +388,8 @@ public CompletableFuture> pullMonitorResultsCsv(
}
/**
- * Returns the most recent run's records as a CSV download. One row per record, with enrichment fields as columns, citations as a JSON column, and connected entities split into event_associated_entities and mention_entities JSON columns.
+ * Returns the most recent run's records as a CSV download. One row per record, with enrichment fields as columns and citations as a JSON column.
+ *
If the monitor's reference job used connected entity datasets, connected entities are split into event_associated_entities and mention_entities JSON columns. When no entity dataset was used, those two columns are omitted from the export entirely.
*/
public CompletableFuture> pullMonitorResultsCsv(
String monitorId, RequestOptions requestOptions) {
@@ -396,7 +398,8 @@ public CompletableFuture> pullMonitorResultsCsv(
}
/**
- * Returns the most recent run's records as a CSV download. One row per record, with enrichment fields as columns, citations as a JSON column, and connected entities split into event_associated_entities and mention_entities JSON columns.
+ * Returns the most recent run's records as a CSV download. One row per record, with enrichment fields as columns and citations as a JSON column.
+ *
If the monitor's reference job used connected entity datasets, connected entities are split into event_associated_entities and mention_entities JSON columns. When no entity dataset was used, those two columns are omitted from the export entirely.
*/
public CompletableFuture> pullMonitorResultsCsv(
String monitorId, PullMonitorResultsCsvRequest request) {
@@ -404,7 +407,8 @@ public CompletableFuture> pullMonitorResultsCsv(
}
/**
- * Returns the most recent run's records as a CSV download. One row per record, with enrichment fields as columns, citations as a JSON column, and connected entities split into event_associated_entities and mention_entities JSON columns.
+ * Returns the most recent run's records as a CSV download. One row per record, with enrichment fields as columns and citations as a JSON column.
+ *
If the monitor's reference job used connected entity datasets, connected entities are split into event_associated_entities and mention_entities JSON columns. When no entity dataset was used, those two columns are omitted from the export entirely.
*/
public CompletableFuture> pullMonitorResultsCsv(
String monitorId, PullMonitorResultsCsvRequest request, RequestOptions requestOptions) {
diff --git a/src/main/java/com/newscatcher/catchall/resources/monitors/MonitorsClient.java b/src/main/java/com/newscatcher/catchall/resources/monitors/MonitorsClient.java
index c36aade..597569f 100644
--- a/src/main/java/com/newscatcher/catchall/resources/monitors/MonitorsClient.java
+++ b/src/main/java/com/newscatcher/catchall/resources/monitors/MonitorsClient.java
@@ -116,28 +116,32 @@ public PullMonitorResponseDto pullMonitorResults(
}
/**
- * Returns the most recent run's records as a CSV download. One row per record, with enrichment fields as columns, citations as a JSON column, and connected entities split into event_associated_entities and mention_entities JSON columns.
+ * Returns the most recent run's records as a CSV download. One row per record, with enrichment fields as columns and citations as a JSON column.
+ *
If the monitor's reference job used connected entity datasets, connected entities are split into event_associated_entities and mention_entities JSON columns. When no entity dataset was used, those two columns are omitted from the export entirely.
*/
public String pullMonitorResultsCsv(String monitorId) {
return this.rawClient.pullMonitorResultsCsv(monitorId).body();
}
/**
- * Returns the most recent run's records as a CSV download. One row per record, with enrichment fields as columns, citations as a JSON column, and connected entities split into event_associated_entities and mention_entities JSON columns.
+ * Returns the most recent run's records as a CSV download. One row per record, with enrichment fields as columns and citations as a JSON column.
+ *
If the monitor's reference job used connected entity datasets, connected entities are split into event_associated_entities and mention_entities JSON columns. When no entity dataset was used, those two columns are omitted from the export entirely.
*/
public String pullMonitorResultsCsv(String monitorId, RequestOptions requestOptions) {
return this.rawClient.pullMonitorResultsCsv(monitorId, requestOptions).body();
}
/**
- * Returns the most recent run's records as a CSV download. One row per record, with enrichment fields as columns, citations as a JSON column, and connected entities split into event_associated_entities and mention_entities JSON columns.
+ * Returns the most recent run's records as a CSV download. One row per record, with enrichment fields as columns and citations as a JSON column.
+ *
If the monitor's reference job used connected entity datasets, connected entities are split into event_associated_entities and mention_entities JSON columns. When no entity dataset was used, those two columns are omitted from the export entirely.
*/
public String pullMonitorResultsCsv(String monitorId, PullMonitorResultsCsvRequest request) {
return this.rawClient.pullMonitorResultsCsv(monitorId, request).body();
}
/**
- * Returns the most recent run's records as a CSV download. One row per record, with enrichment fields as columns, citations as a JSON column, and connected entities split into event_associated_entities and mention_entities JSON columns.
+ * Returns the most recent run's records as a CSV download. One row per record, with enrichment fields as columns and citations as a JSON column.
+ *
If the monitor's reference job used connected entity datasets, connected entities are split into event_associated_entities and mention_entities JSON columns. When no entity dataset was used, those two columns are omitted from the export entirely.
*/
public String pullMonitorResultsCsv(
String monitorId, PullMonitorResultsCsvRequest request, RequestOptions requestOptions) {
diff --git a/src/main/java/com/newscatcher/catchall/resources/monitors/RawMonitorsClient.java b/src/main/java/com/newscatcher/catchall/resources/monitors/RawMonitorsClient.java
index 0fdd954..c57ddec 100644
--- a/src/main/java/com/newscatcher/catchall/resources/monitors/RawMonitorsClient.java
+++ b/src/main/java/com/newscatcher/catchall/resources/monitors/RawMonitorsClient.java
@@ -320,7 +320,8 @@ public CatchAllApiHttpResponse pullMonitorResults(
}
/**
- * Returns the most recent run's records as a CSV download. One row per record, with enrichment fields as columns, citations as a JSON column, and connected entities split into event_associated_entities and mention_entities JSON columns.
+ * Returns the most recent run's records as a CSV download. One row per record, with enrichment fields as columns and citations as a JSON column.
+ *
If the monitor's reference job used connected entity datasets, connected entities are split into event_associated_entities and mention_entities JSON columns. When no entity dataset was used, those two columns are omitted from the export entirely.
*/
public CatchAllApiHttpResponse pullMonitorResultsCsv(String monitorId) {
return pullMonitorResultsCsv(
@@ -328,7 +329,8 @@ public CatchAllApiHttpResponse pullMonitorResultsCsv(String monitorId) {
}
/**
- * Returns the most recent run's records as a CSV download. One row per record, with enrichment fields as columns, citations as a JSON column, and connected entities split into event_associated_entities and mention_entities JSON columns.
+ * Returns the most recent run's records as a CSV download. One row per record, with enrichment fields as columns and citations as a JSON column.
+ *
If the monitor's reference job used connected entity datasets, connected entities are split into event_associated_entities and mention_entities JSON columns. When no entity dataset was used, those two columns are omitted from the export entirely.
*/
public CatchAllApiHttpResponse pullMonitorResultsCsv(String monitorId, RequestOptions requestOptions) {
return pullMonitorResultsCsv(
@@ -336,7 +338,8 @@ public CatchAllApiHttpResponse pullMonitorResultsCsv(String monitorId, R
}
/**
- * Returns the most recent run's records as a CSV download. One row per record, with enrichment fields as columns, citations as a JSON column, and connected entities split into event_associated_entities and mention_entities JSON columns.
+ * Returns the most recent run's records as a CSV download. One row per record, with enrichment fields as columns and citations as a JSON column.
+ *
If the monitor's reference job used connected entity datasets, connected entities are split into event_associated_entities and mention_entities JSON columns. When no entity dataset was used, those two columns are omitted from the export entirely.
*/
public CatchAllApiHttpResponse pullMonitorResultsCsv(
String monitorId, PullMonitorResultsCsvRequest request) {
@@ -344,7 +347,8 @@ public CatchAllApiHttpResponse pullMonitorResultsCsv(
}
/**
- * Returns the most recent run's records as a CSV download. One row per record, with enrichment fields as columns, citations as a JSON column, and connected entities split into event_associated_entities and mention_entities JSON columns.
+ * Returns the most recent run's records as a CSV download. One row per record, with enrichment fields as columns and citations as a JSON column.
+ *
If the monitor's reference job used connected entity datasets, connected entities are split into event_associated_entities and mention_entities JSON columns. When no entity dataset was used, those two columns are omitted from the export entirely.
*/
public CatchAllApiHttpResponse pullMonitorResultsCsv(
String monitorId, PullMonitorResultsCsvRequest request, RequestOptions requestOptions) {
diff --git a/src/main/java/com/newscatcher/catchall/resources/projects/AsyncProjectsClient.java b/src/main/java/com/newscatcher/catchall/resources/projects/AsyncProjectsClient.java
index 01493ac..0000024 100644
--- a/src/main/java/com/newscatcher/catchall/resources/projects/AsyncProjectsClient.java
+++ b/src/main/java/com/newscatcher/catchall/resources/projects/AsyncProjectsClient.java
@@ -117,6 +117,7 @@ public CompletableFuture getProject(
/**
* Deletes a project. By default, assigned resources are unassigned but not deleted.
+ *
Webhooks are an exception: they are never deleted by this operation, even when delete_resources is true. Any attached webhook is detached from the project and continues to exist and deliver, because the same webhook may be attached to other projects.
*/
public CompletableFuture deleteProject(String projectId) {
return this.rawClient.deleteProject(projectId).thenApply(response -> response.body());
@@ -124,6 +125,7 @@ public CompletableFuture deleteProject(String projectId) {
/**
* Deletes a project. By default, assigned resources are unassigned but not deleted.
+ *
Webhooks are an exception: they are never deleted by this operation, even when delete_resources is true. Any attached webhook is detached from the project and continues to exist and deliver, because the same webhook may be attached to other projects.
*/
public CompletableFuture deleteProject(String projectId, RequestOptions requestOptions) {
return this.rawClient.deleteProject(projectId, requestOptions).thenApply(response -> response.body());
@@ -131,6 +133,7 @@ public CompletableFuture deleteProject(String projectId, RequestOptions re
/**
* Deletes a project. By default, assigned resources are unassigned but not deleted.
+ *
Webhooks are an exception: they are never deleted by this operation, even when delete_resources is true. Any attached webhook is detached from the project and continues to exist and deliver, because the same webhook may be attached to other projects.
*/
public CompletableFuture deleteProject(String projectId, DeleteProjectRequest request) {
return this.rawClient.deleteProject(projectId, request).thenApply(response -> response.body());
@@ -138,6 +141,7 @@ public CompletableFuture deleteProject(String projectId, DeleteProjectRequ
/**
* Deletes a project. By default, assigned resources are unassigned but not deleted.
+ *
Webhooks are an exception: they are never deleted by this operation, even when delete_resources is true. Any attached webhook is detached from the project and continues to exist and deliver, because the same webhook may be attached to other projects.
*/
public CompletableFuture deleteProject(
String projectId, DeleteProjectRequest request, RequestOptions requestOptions) {
@@ -176,7 +180,7 @@ public CompletableFuture updateProject(
/**
* Returns resource counts for a project, grouped by type and status.
- *
For jobs and monitors, counts are broken down by status (for example, completed, failed). For datasets and monitor_groups, only a total count is returned.
+ *
For jobs and monitors, counts are broken down by status (for example, completed, failed). For datasets, monitor_groups, and webhooks, only a total count is returned.
*/
public CompletableFuture getProjectOverview(String projectId) {
return this.rawClient.getProjectOverview(projectId).thenApply(response -> response.body());
@@ -184,7 +188,7 @@ public CompletableFuture getProjectOverview(String p
/**
* Returns resource counts for a project, grouped by type and status.
- *
For jobs and monitors, counts are broken down by status (for example, completed, failed). For datasets and monitor_groups, only a total count is returned.
+ *
For jobs and monitors, counts are broken down by status (for example, completed, failed). For datasets, monitor_groups, and webhooks, only a total count is returned.
*/
public CompletableFuture getProjectOverview(
String projectId, RequestOptions requestOptions) {
@@ -193,7 +197,7 @@ public CompletableFuture getProjectOverview(
/**
* Returns resource counts for a project, grouped by type and status.
- *
For jobs and monitors, counts are broken down by status (for example, completed, failed). For datasets and monitor_groups, only a total count is returned.
+ *
For jobs and monitors, counts are broken down by status (for example, completed, failed). For datasets, monitor_groups, and webhooks, only a total count is returned.
*/
public CompletableFuture getProjectOverview(
String projectId, GetProjectOverviewRequest request) {
@@ -202,7 +206,7 @@ public CompletableFuture getProjectOverview(
/**
* Returns resource counts for a project, grouped by type and status.
- *
For jobs and monitors, counts are broken down by status (for example, completed, failed). For datasets and monitor_groups, only a total count is returned.
+ *
For jobs and monitors, counts are broken down by status (for example, completed, failed). For datasets, monitor_groups, and webhooks, only a total count is returned.
*/
public CompletableFuture getProjectOverview(
String projectId, GetProjectOverviewRequest request, RequestOptions requestOptions) {
diff --git a/src/main/java/com/newscatcher/catchall/resources/projects/AsyncRawProjectsClient.java b/src/main/java/com/newscatcher/catchall/resources/projects/AsyncRawProjectsClient.java
index 205e34b..85c6658 100644
--- a/src/main/java/com/newscatcher/catchall/resources/projects/AsyncRawProjectsClient.java
+++ b/src/main/java/com/newscatcher/catchall/resources/projects/AsyncRawProjectsClient.java
@@ -380,6 +380,7 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) {
/**
* Deletes a project. By default, assigned resources are unassigned but not deleted.
+ *
Webhooks are an exception: they are never deleted by this operation, even when delete_resources is true. Any attached webhook is detached from the project and continues to exist and deliver, because the same webhook may be attached to other projects.
*/
public CompletableFuture> deleteProject(String projectId) {
return deleteProject(projectId, DeleteProjectRequest.builder().build());
@@ -387,6 +388,7 @@ public CompletableFuture> deleteProject(String pro
/**
* Deletes a project. By default, assigned resources are unassigned but not deleted.
+ *
Webhooks are an exception: they are never deleted by this operation, even when delete_resources is true. Any attached webhook is detached from the project and continues to exist and deliver, because the same webhook may be attached to other projects.
*/
public CompletableFuture> deleteProject(
String projectId, RequestOptions requestOptions) {
@@ -395,6 +397,7 @@ public CompletableFuture> deleteProject(
/**
* Deletes a project. By default, assigned resources are unassigned but not deleted.
+ *
Webhooks are an exception: they are never deleted by this operation, even when delete_resources is true. Any attached webhook is detached from the project and continues to exist and deliver, because the same webhook may be attached to other projects.
*/
public CompletableFuture> deleteProject(
String projectId, DeleteProjectRequest request) {
@@ -403,6 +406,7 @@ public CompletableFuture> deleteProject(
/**
* Deletes a project. By default, assigned resources are unassigned but not deleted.
+ *
Webhooks are an exception: they are never deleted by this operation, even when delete_resources is true. Any attached webhook is detached from the project and continues to exist and deliver, because the same webhook may be attached to other projects.
*/
public CompletableFuture> deleteProject(
String projectId, DeleteProjectRequest request, RequestOptions requestOptions) {
@@ -604,7 +608,7 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) {
/**
* Returns resource counts for a project, grouped by type and status.
- *
For jobs and monitors, counts are broken down by status (for example, completed, failed). For datasets and monitor_groups, only a total count is returned.
+ *
For jobs and monitors, counts are broken down by status (for example, completed, failed). For datasets, monitor_groups, and webhooks, only a total count is returned.
*/
public CompletableFuture> getProjectOverview(String projectId) {
return getProjectOverview(projectId, GetProjectOverviewRequest.builder().build());
@@ -612,7 +616,7 @@ public CompletableFuture> ge
/**
* Returns resource counts for a project, grouped by type and status.
- *
For jobs and monitors, counts are broken down by status (for example, completed, failed). For datasets and monitor_groups, only a total count is returned.
+ *
For jobs and monitors, counts are broken down by status (for example, completed, failed). For datasets, monitor_groups, and webhooks, only a total count is returned.
*/
public CompletableFuture> getProjectOverview(
String projectId, RequestOptions requestOptions) {
@@ -621,7 +625,7 @@ public CompletableFuture> ge
/**
* Returns resource counts for a project, grouped by type and status.
- *
For jobs and monitors, counts are broken down by status (for example, completed, failed). For datasets and monitor_groups, only a total count is returned.
+ *
For jobs and monitors, counts are broken down by status (for example, completed, failed). For datasets, monitor_groups, and webhooks, only a total count is returned.
*/
public CompletableFuture> getProjectOverview(
String projectId, GetProjectOverviewRequest request) {
@@ -630,7 +634,7 @@ public CompletableFuture> ge
/**
* Returns resource counts for a project, grouped by type and status.
- *
For jobs and monitors, counts are broken down by status (for example, completed, failed). For datasets and monitor_groups, only a total count is returned.
+ *
For jobs and monitors, counts are broken down by status (for example, completed, failed). For datasets, monitor_groups, and webhooks, only a total count is returned.
*/
public CompletableFuture> getProjectOverview(
String projectId, GetProjectOverviewRequest request, RequestOptions requestOptions) {
diff --git a/src/main/java/com/newscatcher/catchall/resources/projects/ProjectsClient.java b/src/main/java/com/newscatcher/catchall/resources/projects/ProjectsClient.java
index 9f88dc4..63dc27a 100644
--- a/src/main/java/com/newscatcher/catchall/resources/projects/ProjectsClient.java
+++ b/src/main/java/com/newscatcher/catchall/resources/projects/ProjectsClient.java
@@ -113,6 +113,7 @@ public ProjectResponseDto getProject(String projectId, GetProjectRequest request
/**
* Deletes a project. By default, assigned resources are unassigned but not deleted.
+ *
Webhooks are an exception: they are never deleted by this operation, even when delete_resources is true. Any attached webhook is detached from the project and continues to exist and deliver, because the same webhook may be attached to other projects.
*/
public void deleteProject(String projectId) {
this.rawClient.deleteProject(projectId).body();
@@ -120,6 +121,7 @@ public void deleteProject(String projectId) {
/**
* Deletes a project. By default, assigned resources are unassigned but not deleted.
+ *
Webhooks are an exception: they are never deleted by this operation, even when delete_resources is true. Any attached webhook is detached from the project and continues to exist and deliver, because the same webhook may be attached to other projects.
*/
public void deleteProject(String projectId, RequestOptions requestOptions) {
this.rawClient.deleteProject(projectId, requestOptions).body();
@@ -127,6 +129,7 @@ public void deleteProject(String projectId, RequestOptions requestOptions) {
/**
* Deletes a project. By default, assigned resources are unassigned but not deleted.
+ *
Webhooks are an exception: they are never deleted by this operation, even when delete_resources is true. Any attached webhook is detached from the project and continues to exist and deliver, because the same webhook may be attached to other projects.
*/
public void deleteProject(String projectId, DeleteProjectRequest request) {
this.rawClient.deleteProject(projectId, request).body();
@@ -134,6 +137,7 @@ public void deleteProject(String projectId, DeleteProjectRequest request) {
/**
* Deletes a project. By default, assigned resources are unassigned but not deleted.
+ *
Webhooks are an exception: they are never deleted by this operation, even when delete_resources is true. Any attached webhook is detached from the project and continues to exist and deliver, because the same webhook may be attached to other projects.
*/
public void deleteProject(String projectId, DeleteProjectRequest request, RequestOptions requestOptions) {
this.rawClient.deleteProject(projectId, request, requestOptions).body();
@@ -170,7 +174,7 @@ public UpdateProjectResponseDto updateProject(
/**
* Returns resource counts for a project, grouped by type and status.
- *
For jobs and monitors, counts are broken down by status (for example, completed, failed). For datasets and monitor_groups, only a total count is returned.
+ *
For jobs and monitors, counts are broken down by status (for example, completed, failed). For datasets, monitor_groups, and webhooks, only a total count is returned.
*/
public ProjectOverviewResponseDto getProjectOverview(String projectId) {
return this.rawClient.getProjectOverview(projectId).body();
@@ -178,7 +182,7 @@ public ProjectOverviewResponseDto getProjectOverview(String projectId) {
/**
* Returns resource counts for a project, grouped by type and status.
- *
For jobs and monitors, counts are broken down by status (for example, completed, failed). For datasets and monitor_groups, only a total count is returned.
+ *
For jobs and monitors, counts are broken down by status (for example, completed, failed). For datasets, monitor_groups, and webhooks, only a total count is returned.
*/
public ProjectOverviewResponseDto getProjectOverview(String projectId, RequestOptions requestOptions) {
return this.rawClient.getProjectOverview(projectId, requestOptions).body();
@@ -186,7 +190,7 @@ public ProjectOverviewResponseDto getProjectOverview(String projectId, RequestOp
/**
* Returns resource counts for a project, grouped by type and status.
- *
For jobs and monitors, counts are broken down by status (for example, completed, failed). For datasets and monitor_groups, only a total count is returned.
+ *
For jobs and monitors, counts are broken down by status (for example, completed, failed). For datasets, monitor_groups, and webhooks, only a total count is returned.
*/
public ProjectOverviewResponseDto getProjectOverview(String projectId, GetProjectOverviewRequest request) {
return this.rawClient.getProjectOverview(projectId, request).body();
@@ -194,7 +198,7 @@ public ProjectOverviewResponseDto getProjectOverview(String projectId, GetProjec
/**
* Returns resource counts for a project, grouped by type and status.
- *
For jobs and monitors, counts are broken down by status (for example, completed, failed). For datasets and monitor_groups, only a total count is returned.
+ *
For jobs and monitors, counts are broken down by status (for example, completed, failed). For datasets, monitor_groups, and webhooks, only a total count is returned.
*/
public ProjectOverviewResponseDto getProjectOverview(
String projectId, GetProjectOverviewRequest request, RequestOptions requestOptions) {
diff --git a/src/main/java/com/newscatcher/catchall/resources/projects/RawProjectsClient.java b/src/main/java/com/newscatcher/catchall/resources/projects/RawProjectsClient.java
index 63215a8..9e33c3d 100644
--- a/src/main/java/com/newscatcher/catchall/resources/projects/RawProjectsClient.java
+++ b/src/main/java/com/newscatcher/catchall/resources/projects/RawProjectsClient.java
@@ -316,6 +316,7 @@ public CatchAllApiHttpResponse getProject(
/**
* Deletes a project. By default, assigned resources are unassigned but not deleted.
+ *
Webhooks are an exception: they are never deleted by this operation, even when delete_resources is true. Any attached webhook is detached from the project and continues to exist and deliver, because the same webhook may be attached to other projects.
*/
public CatchAllApiHttpResponse deleteProject(String projectId) {
return deleteProject(projectId, DeleteProjectRequest.builder().build());
@@ -323,6 +324,7 @@ public CatchAllApiHttpResponse deleteProject(String projectId) {
/**
* Deletes a project. By default, assigned resources are unassigned but not deleted.
+ *
Webhooks are an exception: they are never deleted by this operation, even when delete_resources is true. Any attached webhook is detached from the project and continues to exist and deliver, because the same webhook may be attached to other projects.
*/
public CatchAllApiHttpResponse deleteProject(String projectId, RequestOptions requestOptions) {
return deleteProject(projectId, DeleteProjectRequest.builder().build(), requestOptions);
@@ -330,6 +332,7 @@ public CatchAllApiHttpResponse deleteProject(String projectId, RequestOpti
/**
* Deletes a project. By default, assigned resources are unassigned but not deleted.
+ *
Webhooks are an exception: they are never deleted by this operation, even when delete_resources is true. Any attached webhook is detached from the project and continues to exist and deliver, because the same webhook may be attached to other projects.
*/
public CatchAllApiHttpResponse deleteProject(String projectId, DeleteProjectRequest request) {
return deleteProject(projectId, request, null);
@@ -337,6 +340,7 @@ public CatchAllApiHttpResponse deleteProject(String projectId, DeleteProje
/**
* Deletes a project. By default, assigned resources are unassigned but not deleted.
+ *
Webhooks are an exception: they are never deleted by this operation, even when delete_resources is true. Any attached webhook is detached from the project and continues to exist and deliver, because the same webhook may be attached to other projects.
*/
public CatchAllApiHttpResponse deleteProject(
String projectId, DeleteProjectRequest request, RequestOptions requestOptions) {
@@ -500,7 +504,7 @@ public CatchAllApiHttpResponse updateProject(
/**
* Returns resource counts for a project, grouped by type and status.
- *
For jobs and monitors, counts are broken down by status (for example, completed, failed). For datasets and monitor_groups, only a total count is returned.
+ *
For jobs and monitors, counts are broken down by status (for example, completed, failed). For datasets, monitor_groups, and webhooks, only a total count is returned.
*/
public CatchAllApiHttpResponse getProjectOverview(String projectId) {
return getProjectOverview(projectId, GetProjectOverviewRequest.builder().build());
@@ -508,7 +512,7 @@ public CatchAllApiHttpResponse getProjectOverview(St
/**
* Returns resource counts for a project, grouped by type and status.
- *
For jobs and monitors, counts are broken down by status (for example, completed, failed). For datasets and monitor_groups, only a total count is returned.
+ *
For jobs and monitors, counts are broken down by status (for example, completed, failed). For datasets, monitor_groups, and webhooks, only a total count is returned.
*/
public CatchAllApiHttpResponse getProjectOverview(
String projectId, RequestOptions requestOptions) {
@@ -517,7 +521,7 @@ public CatchAllApiHttpResponse getProjectOverview(
/**
* Returns resource counts for a project, grouped by type and status.
- *
For jobs and monitors, counts are broken down by status (for example, completed, failed). For datasets and monitor_groups, only a total count is returned.
+ *
For jobs and monitors, counts are broken down by status (for example, completed, failed). For datasets, monitor_groups, and webhooks, only a total count is returned.
*/
public CatchAllApiHttpResponse getProjectOverview(
String projectId, GetProjectOverviewRequest request) {
@@ -526,7 +530,7 @@ public CatchAllApiHttpResponse getProjectOverview(
/**
* Returns resource counts for a project, grouped by type and status.
- *
For jobs and monitors, counts are broken down by status (for example, completed, failed). For datasets and monitor_groups, only a total count is returned.
+ *
For jobs and monitors, counts are broken down by status (for example, completed, failed). For datasets, monitor_groups, and webhooks, only a total count is returned.
*/
public CatchAllApiHttpResponse getProjectOverview(
String projectId, GetProjectOverviewRequest request, RequestOptions requestOptions) {
diff --git a/src/main/java/com/newscatcher/catchall/resources/projects/requests/DeleteProjectRequest.java b/src/main/java/com/newscatcher/catchall/resources/projects/requests/DeleteProjectRequest.java
index de000e9..8552907 100644
--- a/src/main/java/com/newscatcher/catchall/resources/projects/requests/DeleteProjectRequest.java
+++ b/src/main/java/com/newscatcher/catchall/resources/projects/requests/DeleteProjectRequest.java
@@ -30,7 +30,8 @@ private DeleteProjectRequest(Optional deleteResources, MapWebhooks are never deleted by either setting — they are only detached from the project.
*/
@JsonProperty("delete_resources")
public Optional getDeleteResources() {
@@ -81,7 +82,8 @@ public Builder from(DeleteProjectRequest other) {
}
/**
- *
If true, permanently deletes all resources (jobs, monitors, datasets) assigned to the project. If false, the project is deleted and its resources are unassigned but not deleted.
+ *
If true, permanently deletes all resources (jobs, monitors, datasets, monitor groups) assigned to the project. If false, the project is deleted and its resources are unassigned but not deleted.
+ *
Webhooks are never deleted by either setting — they are only detached from the project.
*/
@JsonSetter(value = "delete_resources", nulls = Nulls.SKIP)
public Builder deleteResources(Optional deleteResources) {
diff --git a/src/main/java/com/newscatcher/catchall/resources/webhooks/AsyncRawWebhooksClient.java b/src/main/java/com/newscatcher/catchall/resources/webhooks/AsyncRawWebhooksClient.java
index 59ee645..1be0954 100644
--- a/src/main/java/com/newscatcher/catchall/resources/webhooks/AsyncRawWebhooksClient.java
+++ b/src/main/java/com/newscatcher/catchall/resources/webhooks/AsyncRawWebhooksClient.java
@@ -178,6 +178,7 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) {
/**
* Creates a new webhook endpoint for the organization.
+ *
Optionally pass project_id to attach the webhook to a project in the same request.
*/
public CompletableFuture> createWebhook(
CreateWebhookRequestDto request) {
@@ -186,6 +187,7 @@ public CompletableFuture> crea
/**
* Creates a new webhook endpoint for the organization.
+ *
Optionally pass project_id to attach the webhook to a project in the same request.
*/
public CompletableFuture> createWebhook(
CreateWebhookRequestDto request, RequestOptions requestOptions) {
@@ -243,6 +245,11 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO
ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class),
response));
return;
+ case 404:
+ future.completeExceptionally(new NotFoundError(
+ ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class),
+ response));
+ return;
case 422:
future.completeExceptionally(new UnprocessableEntityError(
ObjectMappers.JSON_MAPPER.readValue(
diff --git a/src/main/java/com/newscatcher/catchall/resources/webhooks/AsyncWebhooksClient.java b/src/main/java/com/newscatcher/catchall/resources/webhooks/AsyncWebhooksClient.java
index e414d26..4dca806 100644
--- a/src/main/java/com/newscatcher/catchall/resources/webhooks/AsyncWebhooksClient.java
+++ b/src/main/java/com/newscatcher/catchall/resources/webhooks/AsyncWebhooksClient.java
@@ -76,6 +76,7 @@ public CompletableFuture listWebhooks(
/**
* Creates a new webhook endpoint for the organization.
+ *
Optionally pass project_id to attach the webhook to a project in the same request.
*/
public CompletableFuture createWebhook(CreateWebhookRequestDto request) {
return this.rawClient.createWebhook(request).thenApply(response -> response.body());
@@ -83,6 +84,7 @@ public CompletableFuture createWebhook(CreateWebhookRe
/**
* Creates a new webhook endpoint for the organization.
+ *
Optionally pass project_id to attach the webhook to a project in the same request.
*/
public CompletableFuture createWebhook(
CreateWebhookRequestDto request, RequestOptions requestOptions) {
diff --git a/src/main/java/com/newscatcher/catchall/resources/webhooks/RawWebhooksClient.java b/src/main/java/com/newscatcher/catchall/resources/webhooks/RawWebhooksClient.java
index 779b0d1..0d8b6ee 100644
--- a/src/main/java/com/newscatcher/catchall/resources/webhooks/RawWebhooksClient.java
+++ b/src/main/java/com/newscatcher/catchall/resources/webhooks/RawWebhooksClient.java
@@ -154,6 +154,7 @@ public CatchAllApiHttpResponse listWebhooks(
/**
* Creates a new webhook endpoint for the organization.
+ *
Optionally pass project_id to attach the webhook to a project in the same request.
*/
public CatchAllApiHttpResponse createWebhook(CreateWebhookRequestDto request) {
return createWebhook(request, null);
@@ -161,6 +162,7 @@ public CatchAllApiHttpResponse createWebhook(CreateWeb
/**
* Creates a new webhook endpoint for the organization.
+ *
Optionally pass project_id to attach the webhook to a project in the same request.
*/
public CatchAllApiHttpResponse createWebhook(
CreateWebhookRequestDto request, RequestOptions requestOptions) {
@@ -212,6 +214,9 @@ public CatchAllApiHttpResponse createWebhook(
case 403:
throw new ForbiddenError(
ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response);
+ case 404:
+ throw new NotFoundError(
+ ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response);
case 422:
throw new UnprocessableEntityError(
ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ValidationErrorResponse.class),
diff --git a/src/main/java/com/newscatcher/catchall/resources/webhooks/WebhooksClient.java b/src/main/java/com/newscatcher/catchall/resources/webhooks/WebhooksClient.java
index 8c6769d..a21eda0 100644
--- a/src/main/java/com/newscatcher/catchall/resources/webhooks/WebhooksClient.java
+++ b/src/main/java/com/newscatcher/catchall/resources/webhooks/WebhooksClient.java
@@ -74,6 +74,7 @@ public ListWebhooksResponseDto listWebhooks(ListWebhooksRequest request, Request
/**
* Creates a new webhook endpoint for the organization.
+ *
Optionally pass project_id to attach the webhook to a project in the same request.
*/
public CreateWebhookResponseDto createWebhook(CreateWebhookRequestDto request) {
return this.rawClient.createWebhook(request).body();
@@ -81,6 +82,7 @@ public CreateWebhookResponseDto createWebhook(CreateWebhookRequestDto request) {
/**
* Creates a new webhook endpoint for the organization.
+ *
Optionally pass project_id to attach the webhook to a project in the same request.
*/
public CreateWebhookResponseDto createWebhook(CreateWebhookRequestDto request, RequestOptions requestOptions) {
return this.rawClient.createWebhook(request, requestOptions).body();
diff --git a/src/main/java/com/newscatcher/catchall/resources/webhooks/requests/CreateWebhookRequestDto.java b/src/main/java/com/newscatcher/catchall/resources/webhooks/requests/CreateWebhookRequestDto.java
index 9010e9e..e4ef4e9 100644
--- a/src/main/java/com/newscatcher/catchall/resources/webhooks/requests/CreateWebhookRequestDto.java
+++ b/src/main/java/com/newscatcher/catchall/resources/webhooks/requests/CreateWebhookRequestDto.java
@@ -47,6 +47,8 @@ public final class CreateWebhookRequestDto {
private final Optional formatterConfig;
+ private final Optional projectId;
+
private final Map additionalProperties;
private CreateWebhookRequestDto(
@@ -59,6 +61,7 @@ private CreateWebhookRequestDto(
Optional