From cd276e0209b1f2aec5a9fdb5b515f894663a04e2 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Tue, 4 Aug 2026 12:17:10 +0000 Subject: [PATCH 1/4] [fern-generated] Update SDK Generated by Fern CLI Version: unknown Generators: - fernapi/fern-java-sdk: 4.17.0 --- .fern/metadata.json | 8 +- README.md | 5 +- build.gradle | 4 +- reference.md | 46 ++- .../catchall/AsyncCatchAllApiBuilder.java | 43 ++- .../catchall/CatchAllApiBuilder.java | 43 ++- .../catchall/core/ClientOptions.java | 77 ++++- .../catchall/core/ConsoleLogger.java | 1 + .../ResponseDecompressionInterceptor.java | 56 ++++ .../catchall/core/RetryInterceptor.java | 56 +++- .../resources/jobs/AsyncJobsClient.java | 12 +- .../resources/jobs/AsyncRawJobsClient.java | 16 +- .../catchall/resources/jobs/JobsClient.java | 12 +- .../resources/jobs/RawJobsClient.java | 16 +- .../jobs/requests/GetUserJobsRequest.java | 37 ++- .../jobs/types/GetUserJobsRequestMode.java | 84 ++++++ .../monitors/AsyncMonitorsClient.java | 12 +- .../monitors/AsyncRawMonitorsClient.java | 12 +- .../resources/monitors/MonitorsClient.java | 12 +- .../resources/monitors/RawMonitorsClient.java | 12 +- .../projects/AsyncProjectsClient.java | 12 +- .../projects/AsyncRawProjectsClient.java | 12 +- .../resources/projects/ProjectsClient.java | 12 +- .../resources/projects/RawProjectsClient.java | 12 +- .../requests/DeleteProjectRequest.java | 6 +- .../webhooks/AsyncRawWebhooksClient.java | 7 + .../webhooks/AsyncWebhooksClient.java | 2 + .../resources/webhooks/RawWebhooksClient.java | 5 + .../resources/webhooks/WebhooksClient.java | 2 + .../requests/CreateWebhookRequestDto.java | 96 +++++- .../catchall/types/ApiKeyAuthResponseDto.java | 183 ++++++++++++ .../catchall/types/BasicAuthResponseDto.java | 183 ++++++++++++ .../catchall/types/BearerAuthResponseDto.java | 134 +++++++++ .../types/DeliveryHistoryItemDto.java | 18 +- .../ProjectOverviewResponseDtoOverview.java | 40 ++- .../catchall/types/ProjectResourceDto.java | 8 +- .../catchall/types/ProjectResourceType.java | 10 + .../types/WebhookHistoryResourceType.java | 105 +++++++ .../catchall/types/WebhookResponseDto.java | 82 +++++ .../types/WebhookResponseDtoAuth.java | 282 ++++++++++++++++++ 40 files changed, 1674 insertions(+), 101 deletions(-) create mode 100644 src/main/java/com/newscatcher/catchall/core/ResponseDecompressionInterceptor.java create mode 100644 src/main/java/com/newscatcher/catchall/resources/jobs/types/GetUserJobsRequestMode.java create mode 100644 src/main/java/com/newscatcher/catchall/types/ApiKeyAuthResponseDto.java create mode 100644 src/main/java/com/newscatcher/catchall/types/BasicAuthResponseDto.java create mode 100644 src/main/java/com/newscatcher/catchall/types/BearerAuthResponseDto.java create mode 100644 src/main/java/com/newscatcher/catchall/types/WebhookHistoryResourceType.java create mode 100644 src/main/java/com/newscatcher/catchall/types/WebhookResponseDtoAuth.java diff --git a/.fern/metadata.json b/.fern/metadata.json index 1a0dcac..cbec99d 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -1,16 +1,16 @@ { - "cliVersion": "5.66.0", + "cliVersion": "5.89.4", "generatorName": "fernapi/fern-java-sdk", - "generatorVersion": "4.11.1", + "generatorVersion": "4.17.0", "generatorConfig": { "publish-to": "central", "client-class-name": "CatchAllApi", "package-prefix": "com.newscatcher.catchall" }, - "originGitCommit": "1e66c85a387d0d844162c965656c6a0d36334c11", + "originGitCommit": "3f4bdad0a71333b0f9fb6f42d44d174f2e40167b", "originGitCommitIsDirty": true, "invokedBy": "ci", "requestedVersion": "AUTO", "ciProvider": "unknown", - "sdkVersion": "3.0.3" + "sdkVersion": "0.0.0-fern-placeholder" } \ No newline at end of file diff --git a/README.md b/README.md index 9ceed59..8fabd5c 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ Add the dependency in your `build.gradle` file: ```groovy dependencies { - implementation 'com.newscatcherapi:newscatcher-catchall-sdk:3.0.3' + implementation 'com.newscatcherapi:newscatcher-catchall-sdk:0.0.0-fern-placeholder' } ``` @@ -47,7 +47,7 @@ Add the dependency in your `pom.xml` file: com.newscatcherapi newscatcher-catchall-sdk - 3.0.3 + 0.0.0-fern-placeholder ``` @@ -266,3 +266,4 @@ On the other hand, contributions to the README are always very welcome! + diff --git a/build.gradle b/build.gradle index 97e66a0..50f8a68 100644 --- a/build.gradle +++ b/build.gradle @@ -57,7 +57,7 @@ java { group = 'com.newscatcherapi' -version = '3.0.3' +version = '0.0.0-fern-placeholder' jar { dependsOn(":generatePomFileForMavenPublication") @@ -88,7 +88,7 @@ publishing { maven(MavenPublication) { groupId = 'com.newscatcherapi' artifactId = 'newscatcher-catchall-sdk' - version = '3.0.3' + version = '0.0.0-fern-placeholder' from components.java pom { name = 'newscatcher' diff --git a/reference.md b/reference.md index 889b3fc..cb1e7b8 100644 --- a/reference.md +++ b/reference.md @@ -81,6 +81,14 @@ client.jobs().getUserJobs( **projectId:** `Optional` — Filter results to resources belonging to this project. + + + +
+
+ +**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.
@@ -1060,7 +1070,9 @@ client.monitors().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.
@@ -1602,6 +1614,8 @@ client.webhooks().listWebhooks(
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. +
@@ -4200,7 +4230,9 @@ client.projects().getProject(
-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.
@@ -4243,7 +4275,11 @@ client.projects().deleteProject(
-**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.

*/ public CatchAllApiHttpResponse getJobResultsCsv( String jobId, GetJobResultsCsvRequest request, RequestOptions requestOptions) { diff --git a/src/main/java/com/newscatcher/catchall/resources/jobs/requests/GetUserJobsRequest.java b/src/main/java/com/newscatcher/catchall/resources/jobs/requests/GetUserJobsRequest.java index 7198ba4..321a4f2 100644 --- a/src/main/java/com/newscatcher/catchall/resources/jobs/requests/GetUserJobsRequest.java +++ b/src/main/java/com/newscatcher/catchall/resources/jobs/requests/GetUserJobsRequest.java @@ -12,6 +12,7 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.newscatcher.catchall.core.ObjectMappers; +import com.newscatcher.catchall.resources.jobs.types.GetUserJobsRequestMode; import com.newscatcher.catchall.types.OwnershipFilter; import java.util.HashMap; import java.util.Map; @@ -31,6 +32,8 @@ public final class GetUserJobsRequest { private final Optional projectId; + private final Optional mode; + private final Map additionalProperties; private GetUserJobsRequest( @@ -39,12 +42,14 @@ private GetUserJobsRequest( Optional search, Optional ownership, Optional projectId, + Optional mode, Map additionalProperties) { this.page = page; this.pageSize = pageSize; this.search = search; this.ownership = ownership; this.projectId = projectId; + this.mode = mode; this.additionalProperties = additionalProperties; } @@ -85,6 +90,14 @@ public Optional getProjectId() { return projectId; } + /** + * @return Filter results by processing mode. Returns only jobs that ran in the specified mode. + */ + @JsonProperty("mode") + public Optional getMode() { + return mode; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -101,12 +114,13 @@ private boolean equalTo(GetUserJobsRequest other) { && pageSize.equals(other.pageSize) && search.equals(other.search) && ownership.equals(other.ownership) - && projectId.equals(other.projectId); + && projectId.equals(other.projectId) + && mode.equals(other.mode); } @java.lang.Override public int hashCode() { - return Objects.hash(this.page, this.pageSize, this.search, this.ownership, this.projectId); + return Objects.hash(this.page, this.pageSize, this.search, this.ownership, this.projectId, this.mode); } @java.lang.Override @@ -130,6 +144,8 @@ public static final class Builder { private Optional projectId = Optional.empty(); + private Optional mode = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -141,6 +157,7 @@ public Builder from(GetUserJobsRequest other) { search(other.getSearch()); ownership(other.getOwnership()); projectId(other.getProjectId()); + mode(other.getMode()); return this; } @@ -211,8 +228,22 @@ public Builder projectId(String projectId) { return this; } + /** + *

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> params, Optional auth, Optional formatterConfig, + Optional projectId, Map additionalProperties) { this.name = name; this.url = url; @@ -69,6 +72,7 @@ private CreateWebhookRequestDto( this.params = params; this.auth = auth; this.formatterConfig = formatterConfig; + this.projectId = projectId; this.additionalProperties = additionalProperties; } @@ -151,12 +155,33 @@ public Optional getFormatterConfig() { return formatterConfig; } + /** + * @return Optional project to attach this webhook to at creation time. Equivalent + * to creating the webhook and then calling + * POST /catchAll/projects/{project_id}/resources + * with resource_type: webhook. + *

The project must belong to your organization.

+ */ + @JsonIgnore + public Optional getProjectId() { + if (projectId == null) { + return Optional.empty(); + } + return projectId; + } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("formatter_config") private Optional _getFormatterConfig() { return formatterConfig; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("project_id") + private Optional _getProjectId() { + return projectId; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -177,7 +202,8 @@ private boolean equalTo(CreateWebhookRequestDto other) { && headers.equals(other.headers) && params.equals(other.params) && auth.equals(other.auth) - && formatterConfig.equals(other.formatterConfig); + && formatterConfig.equals(other.formatterConfig) + && projectId.equals(other.projectId); } @java.lang.Override @@ -191,7 +217,8 @@ public int hashCode() { this.headers, this.params, this.auth, - this.formatterConfig); + this.formatterConfig, + this.projectId); } @java.lang.Override @@ -280,6 +307,19 @@ public interface _FinalStage { _FinalStage formatterConfig(FormatterConfigDto formatterConfig); _FinalStage formatterConfig(Nullable formatterConfig); + + /** + *

Optional project to attach this webhook to at creation time. Equivalent + * to creating the webhook and then calling + * POST /catchAll/projects/{project_id}/resources + * with resource_type: webhook.

+ *

The project must belong to your organization.

+ */ + _FinalStage projectId(Optional projectId); + + _FinalStage projectId(String projectId); + + _FinalStage projectId(Nullable projectId); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -288,6 +328,8 @@ public static final class Builder implements NameStage, UrlStage, _FinalStage { private String url; + private Optional projectId = Optional.empty(); + private Optional formatterConfig = Optional.empty(); private Optional auth = Optional.empty(); @@ -318,6 +360,7 @@ public Builder from(CreateWebhookRequestDto other) { params(other.getParams()); auth(other.getAuth()); formatterConfig(other.getFormatterConfig()); + projectId(other.getProjectId()); return this; } @@ -351,6 +394,54 @@ public _FinalStage url(@NotNull String url) { return this; } + /** + *

Optional project to attach this webhook to at creation time. Equivalent + * to creating the webhook and then calling + * POST /catchAll/projects/{project_id}/resources + * with resource_type: webhook.

+ *

The project must belong to your organization.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage projectId(Nullable projectId) { + if (projectId.isNull()) { + this.projectId = null; + } else if (projectId.isEmpty()) { + this.projectId = Optional.empty(); + } else { + this.projectId = Optional.of(projectId.get()); + } + return this; + } + + /** + *

Optional project to attach this webhook to at creation time. Equivalent + * to creating the webhook and then calling + * POST /catchAll/projects/{project_id}/resources + * with resource_type: webhook.

+ *

The project must belong to your organization.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage projectId(String projectId) { + this.projectId = Optional.ofNullable(projectId); + return this; + } + + /** + *

Optional project to attach this webhook to at creation time. Equivalent + * to creating the webhook and then calling + * POST /catchAll/projects/{project_id}/resources + * with resource_type: webhook.

+ *

The project must belong to your organization.

+ */ + @java.lang.Override + @JsonSetter(value = "project_id", nulls = Nulls.SKIP) + public _FinalStage projectId(Optional projectId) { + this.projectId = projectId; + return this; + } + /** *

Custom payload formatter. Required when type is custom.

* @return Reference to {@code this} so that method calls can be chained together. @@ -508,6 +599,7 @@ public CreateWebhookRequestDto build() { params, auth, formatterConfig, + projectId, additionalProperties); } diff --git a/src/main/java/com/newscatcher/catchall/types/ApiKeyAuthResponseDto.java b/src/main/java/com/newscatcher/catchall/types/ApiKeyAuthResponseDto.java new file mode 100644 index 0000000..3cd8a59 --- /dev/null +++ b/src/main/java/com/newscatcher/catchall/types/ApiKeyAuthResponseDto.java @@ -0,0 +1,183 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.newscatcher.catchall.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.newscatcher.catchall.core.Nullable; +import com.newscatcher.catchall.core.NullableNonemptyFilter; +import com.newscatcher.catchall.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ApiKeyAuthResponseDto.Builder.class) +public final class ApiKeyAuthResponseDto { + private final Optional header; + + private final Optional value; + + private final Map additionalProperties; + + private ApiKeyAuthResponseDto( + Optional header, Optional value, Map additionalProperties) { + this.header = header; + this.value = value; + this.additionalProperties = additionalProperties; + } + + /** + * @return HTTP header name for the API key. Returned in full. + */ + @JsonIgnore + public Optional getHeader() { + if (header == null) { + return Optional.empty(); + } + return header; + } + + /** + * @return Masked API key value. Never returned in full. + */ + @JsonIgnore + public Optional getValue() { + if (value == null) { + return Optional.empty(); + } + return value; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("header") + private Optional _getHeader() { + return header; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("value") + private Optional _getValue() { + return value; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ApiKeyAuthResponseDto && equalTo((ApiKeyAuthResponseDto) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ApiKeyAuthResponseDto other) { + return header.equals(other.header) && value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.header, this.value); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional header = Optional.empty(); + + private Optional value = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ApiKeyAuthResponseDto other) { + header(other.getHeader()); + value(other.getValue()); + return this; + } + + /** + *

HTTP header name for the API key. Returned in full.

+ */ + @JsonSetter(value = "header", nulls = Nulls.SKIP) + public Builder header(Optional header) { + this.header = header; + return this; + } + + public Builder header(String header) { + this.header = Optional.ofNullable(header); + return this; + } + + public Builder header(Nullable header) { + if (header.isNull()) { + this.header = null; + } else if (header.isEmpty()) { + this.header = Optional.empty(); + } else { + this.header = Optional.of(header.get()); + } + return this; + } + + /** + *

Masked API key value. Never returned in full.

+ */ + @JsonSetter(value = "value", nulls = Nulls.SKIP) + public Builder value(Optional value) { + this.value = value; + return this; + } + + public Builder value(String value) { + this.value = Optional.ofNullable(value); + return this; + } + + public Builder value(Nullable value) { + if (value.isNull()) { + this.value = null; + } else if (value.isEmpty()) { + this.value = Optional.empty(); + } else { + this.value = Optional.of(value.get()); + } + return this; + } + + public ApiKeyAuthResponseDto build() { + return new ApiKeyAuthResponseDto(header, value, additionalProperties); + } + + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/com/newscatcher/catchall/types/BasicAuthResponseDto.java b/src/main/java/com/newscatcher/catchall/types/BasicAuthResponseDto.java new file mode 100644 index 0000000..a2430f3 --- /dev/null +++ b/src/main/java/com/newscatcher/catchall/types/BasicAuthResponseDto.java @@ -0,0 +1,183 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.newscatcher.catchall.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.newscatcher.catchall.core.Nullable; +import com.newscatcher.catchall.core.NullableNonemptyFilter; +import com.newscatcher.catchall.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = BasicAuthResponseDto.Builder.class) +public final class BasicAuthResponseDto { + private final Optional username; + + private final Optional password; + + private final Map additionalProperties; + + private BasicAuthResponseDto( + Optional username, Optional password, Map additionalProperties) { + this.username = username; + this.password = password; + this.additionalProperties = additionalProperties; + } + + /** + * @return Basic auth username. Returned in full. + */ + @JsonIgnore + public Optional getUsername() { + if (username == null) { + return Optional.empty(); + } + return username; + } + + /** + * @return Masked password. Never returned in full. + */ + @JsonIgnore + public Optional getPassword() { + if (password == null) { + return Optional.empty(); + } + return password; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("username") + private Optional _getUsername() { + return username; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("password") + private Optional _getPassword() { + return password; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof BasicAuthResponseDto && equalTo((BasicAuthResponseDto) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(BasicAuthResponseDto other) { + return username.equals(other.username) && password.equals(other.password); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.username, this.password); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional username = Optional.empty(); + + private Optional password = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(BasicAuthResponseDto other) { + username(other.getUsername()); + password(other.getPassword()); + return this; + } + + /** + *

Basic auth username. Returned in full.

+ */ + @JsonSetter(value = "username", nulls = Nulls.SKIP) + public Builder username(Optional username) { + this.username = username; + return this; + } + + public Builder username(String username) { + this.username = Optional.ofNullable(username); + return this; + } + + public Builder username(Nullable username) { + if (username.isNull()) { + this.username = null; + } else if (username.isEmpty()) { + this.username = Optional.empty(); + } else { + this.username = Optional.of(username.get()); + } + return this; + } + + /** + *

Masked password. Never returned in full.

+ */ + @JsonSetter(value = "password", nulls = Nulls.SKIP) + public Builder password(Optional password) { + this.password = password; + return this; + } + + public Builder password(String password) { + this.password = Optional.ofNullable(password); + return this; + } + + public Builder password(Nullable password) { + if (password.isNull()) { + this.password = null; + } else if (password.isEmpty()) { + this.password = Optional.empty(); + } else { + this.password = Optional.of(password.get()); + } + return this; + } + + public BasicAuthResponseDto build() { + return new BasicAuthResponseDto(username, password, additionalProperties); + } + + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/com/newscatcher/catchall/types/BearerAuthResponseDto.java b/src/main/java/com/newscatcher/catchall/types/BearerAuthResponseDto.java new file mode 100644 index 0000000..30cad14 --- /dev/null +++ b/src/main/java/com/newscatcher/catchall/types/BearerAuthResponseDto.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.newscatcher.catchall.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.newscatcher.catchall.core.Nullable; +import com.newscatcher.catchall.core.NullableNonemptyFilter; +import com.newscatcher.catchall.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = BearerAuthResponseDto.Builder.class) +public final class BearerAuthResponseDto { + private final Optional token; + + private final Map additionalProperties; + + private BearerAuthResponseDto(Optional token, Map additionalProperties) { + this.token = token; + this.additionalProperties = additionalProperties; + } + + /** + * @return Masked bearer token. Never returned in full. + */ + @JsonIgnore + public Optional getToken() { + if (token == null) { + return Optional.empty(); + } + return token; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("token") + private Optional _getToken() { + return token; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof BearerAuthResponseDto && equalTo((BearerAuthResponseDto) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(BearerAuthResponseDto other) { + return token.equals(other.token); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.token); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional token = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(BearerAuthResponseDto other) { + token(other.getToken()); + return this; + } + + /** + *

Masked bearer token. Never returned in full.

+ */ + @JsonSetter(value = "token", nulls = Nulls.SKIP) + public Builder token(Optional token) { + this.token = token; + return this; + } + + public Builder token(String token) { + this.token = Optional.ofNullable(token); + return this; + } + + public Builder token(Nullable token) { + if (token.isNull()) { + this.token = null; + } else if (token.isEmpty()) { + this.token = Optional.empty(); + } else { + this.token = Optional.of(token.get()); + } + return this; + } + + public BearerAuthResponseDto build() { + return new BearerAuthResponseDto(token, additionalProperties); + } + + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/com/newscatcher/catchall/types/DeliveryHistoryItemDto.java b/src/main/java/com/newscatcher/catchall/types/DeliveryHistoryItemDto.java index bce9c8e..61d0058 100644 --- a/src/main/java/com/newscatcher/catchall/types/DeliveryHistoryItemDto.java +++ b/src/main/java/com/newscatcher/catchall/types/DeliveryHistoryItemDto.java @@ -29,7 +29,7 @@ public final class DeliveryHistoryItemDto { private final String webhookId; - private final MappableResourceType resourceType; + private final WebhookHistoryResourceType resourceType; private final String resourceId; @@ -52,7 +52,7 @@ public final class DeliveryHistoryItemDto { private DeliveryHistoryItemDto( int id, String webhookId, - MappableResourceType resourceType, + WebhookHistoryResourceType resourceType, String resourceId, Optional> additionalInfo, int statusCode, @@ -93,10 +93,10 @@ public String getWebhookId() { } /** - * @return Type of the resource that triggered the delivery. + * @return Type of the resource that triggered the delivery. test indicates a manual test delivery not tied to a real resource. */ @JsonProperty("resource_type") - public MappableResourceType getResourceType() { + public WebhookHistoryResourceType getResourceType() { return resourceType; } @@ -250,9 +250,9 @@ public interface WebhookIdStage { public interface ResourceTypeStage { /** - *

Type of the resource that triggered the delivery.

+ *

Type of the resource that triggered the delivery. test indicates a manual test delivery not tied to a real resource.

*/ - ResourceIdStage resourceType(@NotNull MappableResourceType resourceType); + ResourceIdStage resourceType(@NotNull WebhookHistoryResourceType resourceType); } public interface ResourceIdStage { @@ -338,7 +338,7 @@ public static final class Builder private String webhookId; - private MappableResourceType resourceType; + private WebhookHistoryResourceType resourceType; private String resourceId; @@ -400,12 +400,12 @@ public ResourceTypeStage webhookId(@NotNull String webhookId) { } /** - *

Type of the resource that triggered the delivery.

+ *

Type of the resource that triggered the delivery. test indicates a manual test delivery not tied to a real resource.

* @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("resource_type") - public ResourceIdStage resourceType(@NotNull MappableResourceType resourceType) { + public ResourceIdStage resourceType(@NotNull WebhookHistoryResourceType resourceType) { this.resourceType = Objects.requireNonNull(resourceType, "resourceType must not be null"); return this; } diff --git a/src/main/java/com/newscatcher/catchall/types/ProjectOverviewResponseDtoOverview.java b/src/main/java/com/newscatcher/catchall/types/ProjectOverviewResponseDtoOverview.java index e8bb09b..88dd730 100644 --- a/src/main/java/com/newscatcher/catchall/types/ProjectOverviewResponseDtoOverview.java +++ b/src/main/java/com/newscatcher/catchall/types/ProjectOverviewResponseDtoOverview.java @@ -28,6 +28,8 @@ public final class ProjectOverviewResponseDtoOverview { private final Map monitorGroups; + private final Map webhooks; + private final Map additionalProperties; private ProjectOverviewResponseDtoOverview( @@ -35,11 +37,13 @@ private ProjectOverviewResponseDtoOverview( Map monitors, Map datasets, Map monitorGroups, + Map webhooks, Map additionalProperties) { this.jobs = jobs; this.monitors = monitors; this.datasets = datasets; this.monitorGroups = monitorGroups; + this.webhooks = webhooks; this.additionalProperties = additionalProperties; } @@ -63,6 +67,11 @@ public Map getMonitorGroups() { return monitorGroups; } + @JsonProperty("webhooks") + public Map getWebhooks() { + return webhooks; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -79,12 +88,13 @@ private boolean equalTo(ProjectOverviewResponseDtoOverview other) { return jobs.equals(other.jobs) && monitors.equals(other.monitors) && datasets.equals(other.datasets) - && monitorGroups.equals(other.monitorGroups); + && monitorGroups.equals(other.monitorGroups) + && webhooks.equals(other.webhooks); } @java.lang.Override public int hashCode() { - return Objects.hash(this.jobs, this.monitors, this.datasets, this.monitorGroups); + return Objects.hash(this.jobs, this.monitors, this.datasets, this.monitorGroups, this.webhooks); } @java.lang.Override @@ -106,6 +116,8 @@ public static final class Builder { private Map monitorGroups = new LinkedHashMap<>(); + private Map webhooks = new LinkedHashMap<>(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -116,6 +128,7 @@ public Builder from(ProjectOverviewResponseDtoOverview other) { monitors(other.getMonitors()); datasets(other.getDatasets()); monitorGroups(other.getMonitorGroups()); + webhooks(other.getWebhooks()); return this; } @@ -203,9 +216,30 @@ public Builder monitorGroups(String key, Object value) { return this; } + @JsonSetter(value = "webhooks", nulls = Nulls.SKIP) + public Builder webhooks(Map webhooks) { + this.webhooks.clear(); + if (webhooks != null) { + this.webhooks.putAll(webhooks); + } + return this; + } + + public Builder putAllWebhooks(Map webhooks) { + if (webhooks != null) { + this.webhooks.putAll(webhooks); + } + return this; + } + + public Builder webhooks(String key, Object value) { + this.webhooks.put(key, value); + return this; + } + public ProjectOverviewResponseDtoOverview build() { return new ProjectOverviewResponseDtoOverview( - jobs, monitors, datasets, monitorGroups, additionalProperties); + jobs, monitors, datasets, monitorGroups, webhooks, additionalProperties); } public Builder additionalProperty(String key, Object value) { diff --git a/src/main/java/com/newscatcher/catchall/types/ProjectResourceDto.java b/src/main/java/com/newscatcher/catchall/types/ProjectResourceDto.java index 9181b77..46e5e72 100644 --- a/src/main/java/com/newscatcher/catchall/types/ProjectResourceDto.java +++ b/src/main/java/com/newscatcher/catchall/types/ProjectResourceDto.java @@ -64,7 +64,7 @@ public String getResourceId() { /** * @return Resource display name. For jobs, this is the original query - * string. For monitors and datasets, this is the resource name. + * string. For monitors, datasets, and webhooks, this is the resource name. */ @JsonProperty("name") public Optional getName() { @@ -142,7 +142,7 @@ public interface _FinalStage { /** *

Resource display name. For jobs, this is the original query - * string. For monitors and datasets, this is the resource name.

+ * string. For monitors, datasets, and webhooks, this is the resource name.

*/ _FinalStage name(Optional name); @@ -250,7 +250,7 @@ public _FinalStage createdAt(Optional createdAt) { /** *

Resource display name. For jobs, this is the original query - * string. For monitors and datasets, this is the resource name.

+ * string. For monitors, datasets, and webhooks, this is the resource name.

* @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @@ -261,7 +261,7 @@ public _FinalStage name(String name) { /** *

Resource display name. For jobs, this is the original query - * string. For monitors and datasets, this is the resource name.

+ * string. For monitors, datasets, and webhooks, this is the resource name.

*/ @java.lang.Override @JsonSetter(value = "name", nulls = Nulls.SKIP) diff --git a/src/main/java/com/newscatcher/catchall/types/ProjectResourceType.java b/src/main/java/com/newscatcher/catchall/types/ProjectResourceType.java index 8d0fd1d..c1886bb 100644 --- a/src/main/java/com/newscatcher/catchall/types/ProjectResourceType.java +++ b/src/main/java/com/newscatcher/catchall/types/ProjectResourceType.java @@ -7,6 +7,8 @@ import com.fasterxml.jackson.annotation.JsonValue; public final class ProjectResourceType { + public static final ProjectResourceType WEBHOOK = new ProjectResourceType(Value.WEBHOOK, "webhook"); + public static final ProjectResourceType MONITOR = new ProjectResourceType(Value.MONITOR, "monitor"); public static final ProjectResourceType JOB = new ProjectResourceType(Value.JOB, "job"); @@ -48,6 +50,8 @@ public int hashCode() { public T visit(Visitor visitor) { switch (value) { + case WEBHOOK: + return visitor.visitWebhook(); case MONITOR: return visitor.visitMonitor(); case JOB: @@ -65,6 +69,8 @@ public T visit(Visitor visitor) { @JsonCreator(mode = JsonCreator.Mode.DELEGATING) public static ProjectResourceType valueOf(String value) { switch (value) { + case "webhook": + return WEBHOOK; case "monitor": return MONITOR; case "job": @@ -87,6 +93,8 @@ public enum Value { MONITOR_GROUP, + WEBHOOK, + UNKNOWN } @@ -99,6 +107,8 @@ public interface Visitor { T visitMonitorGroup(); + T visitWebhook(); + T visitUnknown(String unknownType); } } diff --git a/src/main/java/com/newscatcher/catchall/types/WebhookHistoryResourceType.java b/src/main/java/com/newscatcher/catchall/types/WebhookHistoryResourceType.java new file mode 100644 index 0000000..244852a --- /dev/null +++ b/src/main/java/com/newscatcher/catchall/types/WebhookHistoryResourceType.java @@ -0,0 +1,105 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.newscatcher.catchall.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class WebhookHistoryResourceType { + public static final WebhookHistoryResourceType MONITOR = new WebhookHistoryResourceType(Value.MONITOR, "monitor"); + + public static final WebhookHistoryResourceType TEST = new WebhookHistoryResourceType(Value.TEST, "test"); + + public static final WebhookHistoryResourceType JOB = new WebhookHistoryResourceType(Value.JOB, "job"); + + public static final WebhookHistoryResourceType MONITOR_GROUP = + new WebhookHistoryResourceType(Value.MONITOR_GROUP, "monitor_group"); + + private final Value value; + + private final String string; + + WebhookHistoryResourceType(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 WebhookHistoryResourceType + && this.string.equals(((WebhookHistoryResourceType) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case MONITOR: + return visitor.visitMonitor(); + case TEST: + return visitor.visitTest(); + case JOB: + return visitor.visitJob(); + case MONITOR_GROUP: + return visitor.visitMonitorGroup(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static WebhookHistoryResourceType valueOf(String value) { + switch (value) { + case "monitor": + return MONITOR; + case "test": + return TEST; + case "job": + return JOB; + case "monitor_group": + return MONITOR_GROUP; + default: + return new WebhookHistoryResourceType(Value.UNKNOWN, value); + } + } + + public enum Value { + JOB, + + MONITOR, + + MONITOR_GROUP, + + TEST, + + UNKNOWN + } + + public interface Visitor { + T visitJob(); + + T visitMonitor(); + + T visitMonitorGroup(); + + T visitTest(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/newscatcher/catchall/types/WebhookResponseDto.java b/src/main/java/com/newscatcher/catchall/types/WebhookResponseDto.java index 693a21c..3fd1358 100644 --- a/src/main/java/com/newscatcher/catchall/types/WebhookResponseDto.java +++ b/src/main/java/com/newscatcher/catchall/types/WebhookResponseDto.java @@ -41,6 +41,8 @@ public final class WebhookResponseDto { private final Optional> params; + private final Optional auth; + private final Optional formatterConfig; private final boolean isActive; @@ -64,6 +66,7 @@ private WebhookResponseDto( HttpMethod method, Optional> headers, Optional> params, + Optional auth, Optional formatterConfig, boolean isActive, Optional organizationId, @@ -79,6 +82,7 @@ private WebhookResponseDto( this.method = method; this.headers = headers; this.params = params; + this.auth = auth; this.formatterConfig = formatterConfig; this.isActive = isActive; this.organizationId = organizationId; @@ -143,6 +147,19 @@ public Optional> getParams() { return params; } + /** + * @return Authentication configured for this webhook, discriminated by type. + * Secret values (token, value, password) are masked — the full + * credentials are never returned. Null when no authentication is set. + */ + @JsonIgnore + public Optional getAuth() { + if (auth == null) { + return Optional.empty(); + } + return auth; + } + /** * @return Custom payload formatter. Set only when type is custom. */ @@ -194,6 +211,12 @@ public Optional getUpdatedAt() { return updatedAt; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("auth") + private Optional _getAuth() { + return auth; + } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("formatter_config") private Optional _getFormatterConfig() { @@ -220,6 +243,7 @@ private boolean equalTo(WebhookResponseDto other) { && method.equals(other.method) && headers.equals(other.headers) && params.equals(other.params) + && auth.equals(other.auth) && formatterConfig.equals(other.formatterConfig) && isActive == other.isActive && organizationId.equals(other.organizationId) @@ -239,6 +263,7 @@ public int hashCode() { this.method, this.headers, this.params, + this.auth, this.formatterConfig, this.isActive, this.organizationId, @@ -319,6 +344,17 @@ public interface _FinalStage { _FinalStage params(Map params); + /** + *

Authentication configured for this webhook, discriminated by type. + * Secret values (token, value, password) are masked — the full + * credentials are never returned. Null when no authentication is set.

+ */ + _FinalStage auth(Optional auth); + + _FinalStage auth(WebhookResponseDtoAuth auth); + + _FinalStage auth(Nullable auth); + /** *

Custom payload formatter. Set only when type is custom.

*/ @@ -391,6 +427,8 @@ public static final class Builder private Optional formatterConfig = Optional.empty(); + private Optional auth = Optional.empty(); + private Optional> params = Optional.empty(); private Optional> headers = Optional.empty(); @@ -410,6 +448,7 @@ public Builder from(WebhookResponseDto other) { method(other.getMethod()); headers(other.getHeaders()); params(other.getParams()); + auth(other.getAuth()); formatterConfig(other.getFormatterConfig()); isActive(other.getIsActive()); organizationId(other.getOrganizationId()); @@ -600,6 +639,48 @@ public _FinalStage formatterConfig(Optional formatterConfig) return this; } + /** + *

Authentication configured for this webhook, discriminated by type. + * Secret values (token, value, password) are masked — the full + * credentials are never returned. Null when no authentication is set.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage auth(Nullable auth) { + if (auth.isNull()) { + this.auth = null; + } else if (auth.isEmpty()) { + this.auth = Optional.empty(); + } else { + this.auth = Optional.of(auth.get()); + } + return this; + } + + /** + *

Authentication configured for this webhook, discriminated by type. + * Secret values (token, value, password) are masked — the full + * credentials are never returned. Null when no authentication is set.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage auth(WebhookResponseDtoAuth auth) { + this.auth = Optional.ofNullable(auth); + return this; + } + + /** + *

Authentication configured for this webhook, discriminated by type. + * Secret values (token, value, password) are masked — the full + * credentials are never returned. Null when no authentication is set.

+ */ + @java.lang.Override + @JsonSetter(value = "auth", nulls = Nulls.SKIP) + public _FinalStage auth(Optional auth) { + this.auth = auth; + return this; + } + /** *

Query parameters appended to the webhook URL.

* @return Reference to {@code this} so that method calls can be chained together. @@ -651,6 +732,7 @@ public WebhookResponseDto build() { method, headers, params, + auth, formatterConfig, isActive, organizationId, diff --git a/src/main/java/com/newscatcher/catchall/types/WebhookResponseDtoAuth.java b/src/main/java/com/newscatcher/catchall/types/WebhookResponseDtoAuth.java new file mode 100644 index 0000000..8da49a7 --- /dev/null +++ b/src/main/java/com/newscatcher/catchall/types/WebhookResponseDtoAuth.java @@ -0,0 +1,282 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.newscatcher.catchall.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonUnwrapped; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Objects; +import java.util.Optional; + +public final class WebhookResponseDtoAuth { + private final Value value; + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + private WebhookResponseDtoAuth(Value value) { + this.value = value; + } + + public T visit(Visitor visitor) { + return value.visit(visitor); + } + + public static WebhookResponseDtoAuth bearer(BearerAuthResponseDto value) { + return new WebhookResponseDtoAuth(new BearerValue(value)); + } + + public static WebhookResponseDtoAuth apiKey(ApiKeyAuthResponseDto value) { + return new WebhookResponseDtoAuth(new ApiKeyValue(value)); + } + + public static WebhookResponseDtoAuth basic(BasicAuthResponseDto value) { + return new WebhookResponseDtoAuth(new BasicValue(value)); + } + + public boolean isBearer() { + return value instanceof BearerValue; + } + + public boolean isApiKey() { + return value instanceof ApiKeyValue; + } + + public boolean isBasic() { + return value instanceof BasicValue; + } + + public boolean _isUnknown() { + return value instanceof _UnknownValue; + } + + public Optional getBearer() { + if (isBearer()) { + return Optional.of(((BearerValue) value).value); + } + return Optional.empty(); + } + + public Optional getApiKey() { + if (isApiKey()) { + return Optional.of(((ApiKeyValue) value).value); + } + return Optional.empty(); + } + + public Optional getBasic() { + if (isBasic()) { + return Optional.of(((BasicValue) value).value); + } + return Optional.empty(); + } + + public Optional _getUnknown() { + if (_isUnknown()) { + return Optional.of(((_UnknownValue) value).value); + } + return Optional.empty(); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof WebhookResponseDtoAuth && value.equals(((WebhookResponseDtoAuth) other).value); + } + + @Override + public int hashCode() { + return Objects.hash(value); + } + + @Override + public String toString() { + return value.toString(); + } + + @JsonValue + private Value getValue() { + return this.value; + } + + public interface Visitor { + T visitBearer(BearerAuthResponseDto bearer); + + T visitApiKey(ApiKeyAuthResponseDto apiKey); + + T visitBasic(BasicAuthResponseDto basic); + + T _visitUnknown(Object unknownType); + } + + @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type", visible = true, defaultImpl = _UnknownValue.class) + @JsonSubTypes({ + @JsonSubTypes.Type(BearerValue.class), + @JsonSubTypes.Type(ApiKeyValue.class), + @JsonSubTypes.Type(BasicValue.class) + }) + @JsonIgnoreProperties(ignoreUnknown = true) + private interface Value { + T visit(Visitor visitor); + } + + @JsonTypeName("bearer") + @JsonIgnoreProperties("type") + private static final class BearerValue implements Value { + @JsonUnwrapped + @JsonIgnoreProperties(value = "type", allowSetters = true) + private BearerAuthResponseDto value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private BearerValue() {} + + private BearerValue(BearerAuthResponseDto value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitBearer(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof BearerValue && equalTo((BearerValue) other); + } + + private boolean equalTo(BearerValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "WebhookResponseDtoAuth{" + "value: " + value + "}"; + } + } + + @JsonTypeName("api_key") + @JsonIgnoreProperties("type") + private static final class ApiKeyValue implements Value { + @JsonUnwrapped + @JsonIgnoreProperties(value = "type", allowSetters = true) + private ApiKeyAuthResponseDto value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private ApiKeyValue() {} + + private ApiKeyValue(ApiKeyAuthResponseDto value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitApiKey(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ApiKeyValue && equalTo((ApiKeyValue) other); + } + + private boolean equalTo(ApiKeyValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "WebhookResponseDtoAuth{" + "value: " + value + "}"; + } + } + + @JsonTypeName("basic") + @JsonIgnoreProperties("type") + private static final class BasicValue implements Value { + @JsonUnwrapped + @JsonIgnoreProperties(value = "type", allowSetters = true) + private BasicAuthResponseDto value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private BasicValue() {} + + private BasicValue(BasicAuthResponseDto value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitBasic(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof BasicValue && equalTo((BasicValue) other); + } + + private boolean equalTo(BasicValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "WebhookResponseDtoAuth{" + "value: " + value + "}"; + } + } + + @JsonIgnoreProperties("type") + private static final class _UnknownValue implements Value { + private String type; + + @JsonValue + private Object value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private _UnknownValue(@JsonProperty("value") Object value) {} + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor._visitUnknown(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof _UnknownValue && equalTo((_UnknownValue) other); + } + + private boolean equalTo(_UnknownValue other) { + return type.equals(other.type) && value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.type, this.value); + } + + @java.lang.Override + public String toString() { + return "WebhookResponseDtoAuth{" + "type: " + type + ", value: " + value + "}"; + } + } +} From 2ac5522f246be0c12ee7f3081a2d8071baa06c47 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Tue, 4 Aug 2026 12:17:11 +0000 Subject: [PATCH 2/4] [fern-autoversion] SDK regeneration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🌿 Generated with Fern --- .fern/metadata.json | 2 +- README.md | 4 ++-- build.gradle | 4 ++-- .../java/com/newscatcher/catchall/core/ClientOptions.java | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.fern/metadata.json b/.fern/metadata.json index cbec99d..eb42e81 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -12,5 +12,5 @@ "invokedBy": "ci", "requestedVersion": "AUTO", "ciProvider": "unknown", - "sdkVersion": "0.0.0-fern-placeholder" + "sdkVersion": "3.0.4" } \ No newline at end of file diff --git a/README.md b/README.md index 8fabd5c..3222a2d 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ Add the dependency in your `build.gradle` file: ```groovy dependencies { - implementation 'com.newscatcherapi:newscatcher-catchall-sdk:0.0.0-fern-placeholder' + implementation 'com.newscatcherapi:newscatcher-catchall-sdk:3.0.4' } ``` @@ -47,7 +47,7 @@ Add the dependency in your `pom.xml` file: com.newscatcherapi newscatcher-catchall-sdk - 0.0.0-fern-placeholder + 3.0.4 ``` diff --git a/build.gradle b/build.gradle index 50f8a68..f09ee71 100644 --- a/build.gradle +++ b/build.gradle @@ -57,7 +57,7 @@ java { group = 'com.newscatcherapi' -version = '0.0.0-fern-placeholder' +version = '3.0.4' jar { dependsOn(":generatePomFileForMavenPublication") @@ -88,7 +88,7 @@ publishing { maven(MavenPublication) { groupId = 'com.newscatcherapi' artifactId = 'newscatcher-catchall-sdk' - version = '0.0.0-fern-placeholder' + version = '3.0.4' from components.java pom { name = 'newscatcher' diff --git a/src/main/java/com/newscatcher/catchall/core/ClientOptions.java b/src/main/java/com/newscatcher/catchall/core/ClientOptions.java index 7c5b4e3..4eaa689 100644 --- a/src/main/java/com/newscatcher/catchall/core/ClientOptions.java +++ b/src/main/java/com/newscatcher/catchall/core/ClientOptions.java @@ -47,10 +47,10 @@ private ClientOptions( this.headers.putAll(headers); this.headers.putAll(new HashMap() { { - put("User-Agent", "com.newscatcherapi.newscatcher-catchall-sdk/0.0.0-fern-placeholder"); + put("User-Agent", "com.newscatcherapi.newscatcher-catchall-sdk/3.0.4"); put("X-Fern-Language", "JAVA"); put("X-Fern-SDK-Name", "com.newscatcherapi:newscatcher-catchall-sdk"); - put("X-Fern-SDK-Version", "0.0.0-fern-placeholder"); + put("X-Fern-SDK-Version", "3.0.4"); } }); this.headerSuppliers = headerSuppliers; From 51e9fa8a5c4c2b1cc6fc6527f81e91c60b320713 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Tue, 4 Aug 2026 12:17:11 +0000 Subject: [PATCH 3/4] [fern-replay] advance lockfile --- .fern/replay.lock | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.fern/replay.lock b/.fern/replay.lock index ab10719..c1012b1 100644 --- a/.fern/replay.lock +++ b/.fern/replay.lock @@ -6,5 +6,11 @@ generations: timestamp: 2026-05-29T12:58:06.809Z cli_version: unknown generator_versions: {} -current_generation: 4bf57ec2b0c2b8d170a06ccc5b084eb9ca3fba55 + - commit_sha: 5855dcc73133889ded68524f74e61af3cf971e68 + tree_hash: 0249533ac53c42211df9fe715ae8a02137f54063 + timestamp: 2026-08-04T12:16:08.204Z + cli_version: unknown + generator_versions: + fernapi/fern-java-sdk: 4.17.0 +current_generation: 5855dcc73133889ded68524f74e61af3cf971e68 patches: [] From 8fe74ede4d445defbc41f463e34338d5505400bd Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Tue, 4 Aug 2026 12:17:12 +0000 Subject: [PATCH 4/4] SDK regeneration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🌿 Generated with Fern --- changelog.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/changelog.md b/changelog.md index 26d0bf2..48e8ee7 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,5 @@ +## [3.0.4] - 2026-08-04 + ## 2.0.0 - 2026-05-19 ### Breaking Changes * **`ListEntitiesInDatasetRequest`** — renamed to **`ListDatasetEntitiesRequest`**; update all imports and usages to the new class name.