client.datasets.listEntitiesInDataset(datasetId) -> DatasetEntityListResponseclient.datasets.addEntitiesToDataset(datasetId, request) -> ManageEntitiesResponseclient.datasets.addEntitiesToDataset(datasetId, request) -> ManageEntitiesResponseclient.datasets.removeEntitiesFromDataset(datasetId, request) -> ManageEntitiesResponseclient.datasets.removeEntitiesFromDataset(datasetId, request) -> ManageEntitiesResponseclient.datasets.listEntitiesInDataset(datasetId, request) -> DatasetEntityListResponsename column is required; all other columns
- * are optional.
+ * Creates a new dataset by uploading a CSV file. Each row in the CSV becomes an entity. The name and domaincolumns are required; all other columns are optional.
* CSV format:
*name,description,domain,alternative_names,key_persons
* NewsCatcher,"AI-powered news data provider",newscatcherapi.com,"NC;NewsCatcher API","Artem Bugara;Maksym Sugonyaka"
@@ -125,9 +115,7 @@ public CompletableFuture createDatasetFromCsv(
}
/**
- * Creates a new dataset by uploading a CSV file. Each row in the CSV
- * becomes an entity. The name column is required; all other columns
- * are optional.
+ * Creates a new dataset by uploading a CSV file. Each row in the CSV becomes an entity. The name and domaincolumns are required; all other columns are optional.
* CSV format:
* name,description,domain,alternative_names,key_persons
* NewsCatcher,"AI-powered news data provider",newscatcherapi.com,"NC;NewsCatcher API","Artem Bugara;Maksym Sugonyaka"
@@ -262,89 +250,83 @@ public CompletableFuture updateDataset(
}
/**
- * Returns a paginated list of entities in a dataset. Supports filtering by status and entity type.
+ * Adds one or more existing entities to a dataset. Returns the number of entities added.
*/
- public CompletableFuture listEntitiesInDataset(String datasetId) {
- return this.rawClient.listEntitiesInDataset(datasetId).thenApply(response -> response.body());
+ public CompletableFuture addEntitiesToDataset(
+ String datasetId, AddEntitiesToDatasetRequest request) {
+ return this.rawClient.addEntitiesToDataset(datasetId, request).thenApply(response -> response.body());
}
/**
- * Returns a paginated list of entities in a dataset. Supports filtering by status and entity type.
+ * Adds one or more existing entities to a dataset. Returns the number of entities added.
*/
- public CompletableFuture listEntitiesInDataset(
- String datasetId, RequestOptions requestOptions) {
- return this.rawClient.listEntitiesInDataset(datasetId, requestOptions).thenApply(response -> response.body());
+ public CompletableFuture addEntitiesToDataset(
+ String datasetId, AddEntitiesToDatasetRequest request, RequestOptions requestOptions) {
+ return this.rawClient
+ .addEntitiesToDataset(datasetId, request, requestOptions)
+ .thenApply(response -> response.body());
}
/**
- * Returns a paginated list of entities in a dataset. Supports filtering by status and entity type.
+ * Removes one or more entities from a dataset. The entities themselves are not deleted — they are only removed from this dataset. Returns the number of entities removed.
*/
- public CompletableFuture listEntitiesInDataset(
- String datasetId, ListEntitiesInDatasetRequest request) {
- return this.rawClient.listEntitiesInDataset(datasetId, request).thenApply(response -> response.body());
+ public CompletableFuture removeEntitiesFromDataset(
+ String datasetId, RemoveEntitiesFromDatasetRequest request) {
+ return this.rawClient.removeEntitiesFromDataset(datasetId, request).thenApply(response -> response.body());
}
/**
- * Returns a paginated list of entities in a dataset. Supports filtering by status and entity type.
+ * Removes one or more entities from a dataset. The entities themselves are not deleted — they are only removed from this dataset. Returns the number of entities removed.
*/
- public CompletableFuture listEntitiesInDataset(
- String datasetId, ListEntitiesInDatasetRequest request, RequestOptions requestOptions) {
+ public CompletableFuture removeEntitiesFromDataset(
+ String datasetId, RemoveEntitiesFromDatasetRequest request, RequestOptions requestOptions) {
return this.rawClient
- .listEntitiesInDataset(datasetId, request, requestOptions)
+ .removeEntitiesFromDataset(datasetId, request, requestOptions)
.thenApply(response -> response.body());
}
/**
- * Adds one or more existing entities to a dataset. Returns the number of entities added.
+ * Returns a paginated list of entities in a dataset. Supports filtering by status, entity type, and name search.
*/
- public CompletableFuture addEntitiesToDataset(
- String datasetId, AddEntitiesToDatasetRequest request) {
- return this.rawClient.addEntitiesToDataset(datasetId, request).thenApply(response -> response.body());
+ public CompletableFuture listEntitiesInDataset(String datasetId) {
+ return this.rawClient.listEntitiesInDataset(datasetId).thenApply(response -> response.body());
}
/**
- * Adds one or more existing entities to a dataset. Returns the number of entities added.
+ * Returns a paginated list of entities in a dataset. Supports filtering by status, entity type, and name search.
*/
- public CompletableFuture addEntitiesToDataset(
- String datasetId, AddEntitiesToDatasetRequest request, RequestOptions requestOptions) {
- return this.rawClient
- .addEntitiesToDataset(datasetId, request, requestOptions)
- .thenApply(response -> response.body());
+ public CompletableFuture listEntitiesInDataset(
+ String datasetId, RequestOptions requestOptions) {
+ return this.rawClient.listEntitiesInDataset(datasetId, requestOptions).thenApply(response -> response.body());
}
/**
- * Removes one or more entities from a dataset. The entities themselves
- * are not deleted — they are only removed from this dataset. Returns
- * the number of entities removed.
+ * Returns a paginated list of entities in a dataset. Supports filtering by status, entity type, and name search.
*/
- public CompletableFuture removeEntitiesFromDataset(
- String datasetId, RemoveEntitiesFromDatasetRequest request) {
- return this.rawClient.removeEntitiesFromDataset(datasetId, request).thenApply(response -> response.body());
+ public CompletableFuture listEntitiesInDataset(
+ String datasetId, ListDatasetEntitiesRequest request) {
+ return this.rawClient.listEntitiesInDataset(datasetId, request).thenApply(response -> response.body());
}
/**
- * Removes one or more entities from a dataset. The entities themselves
- * are not deleted — they are only removed from this dataset. Returns
- * the number of entities removed.
+ * Returns a paginated list of entities in a dataset. Supports filtering by status, entity type, and name search.
*/
- public CompletableFuture removeEntitiesFromDataset(
- String datasetId, RemoveEntitiesFromDatasetRequest request, RequestOptions requestOptions) {
+ public CompletableFuture listEntitiesInDataset(
+ String datasetId, ListDatasetEntitiesRequest request, RequestOptions requestOptions) {
return this.rawClient
- .removeEntitiesFromDataset(datasetId, request, requestOptions)
+ .listEntitiesInDataset(datasetId, request, requestOptions)
.thenApply(response -> response.body());
}
/**
- * Returns the full status change history for a dataset, ordered
- * chronologically from oldest to newest.
+ * Returns the full status change history for a dataset, ordered chronologically from oldest to newest.
*/
public CompletableFuture getDatasetStatusHistory(String datasetId) {
return this.rawClient.getDatasetStatusHistory(datasetId).thenApply(response -> response.body());
}
/**
- * Returns the full status change history for a dataset, ordered
- * chronologically from oldest to newest.
+ * Returns the full status change history for a dataset, ordered chronologically from oldest to newest.
*/
public CompletableFuture getDatasetStatusHistory(
String datasetId, RequestOptions requestOptions) {
@@ -352,8 +334,7 @@ public CompletableFuture getDatasetStatusHistory(
}
/**
- * Returns the full status change history for a dataset, ordered
- * chronologically from oldest to newest.
+ * Returns the full status change history for a dataset, ordered chronologically from oldest to newest.
*/
public CompletableFuture getDatasetStatusHistory(
String datasetId, GetDatasetStatusHistoryRequest request) {
@@ -361,8 +342,7 @@ public CompletableFuture getDatasetStatusHistory(
}
/**
- * Returns the full status change history for a dataset, ordered
- * chronologically from oldest to newest.
+ * Returns the full status change history for a dataset, ordered chronologically from oldest to newest.
*/
public CompletableFuture getDatasetStatusHistory(
String datasetId, GetDatasetStatusHistoryRequest request, RequestOptions requestOptions) {
@@ -372,10 +352,8 @@ public CompletableFuture getDatasetStatusHistory(
}
/**
- * Appends new companies to an existing dataset by uploading a CSV file.
- * Uses the same CSV format as the dataset creation endpoint.
- * The response omits dataset_name compared to the create-from-CSV
- * endpoint since the dataset already exists.
+ * Appends new companies to an existing dataset by uploading a CSV file. Uses the same CSV format as the dataset creation endpoint.
+ * The response omits dataset_name compared to the create-from-CSV endpoint since the dataset already exists.
*/
public CompletableFuture uploadCsvToDataset(
String datasetId, File file, UploadCsvToDatasetRequest request) {
@@ -383,10 +361,8 @@ public CompletableFuture uploadCsvToDataset(
}
/**
- * Appends new companies to an existing dataset by uploading a CSV file.
- * Uses the same CSV format as the dataset creation endpoint.
- * The response omits dataset_name compared to the create-from-CSV
- * endpoint since the dataset already exists.
+ * Appends new companies to an existing dataset by uploading a CSV file. Uses the same CSV format as the dataset creation endpoint.
+ * The response omits dataset_name compared to the create-from-CSV endpoint since the dataset already exists.
*/
public CompletableFuture uploadCsvToDataset(
String datasetId, File file, UploadCsvToDatasetRequest request, RequestOptions requestOptions) {
diff --git a/src/main/java/com/newscatcher/catchall/resources/datasets/AsyncRawDatasetsClient.java b/src/main/java/com/newscatcher/catchall/resources/datasets/AsyncRawDatasetsClient.java
index ccd5bb1..556327a 100644
--- a/src/main/java/com/newscatcher/catchall/resources/datasets/AsyncRawDatasetsClient.java
+++ b/src/main/java/com/newscatcher/catchall/resources/datasets/AsyncRawDatasetsClient.java
@@ -23,8 +23,8 @@
import com.newscatcher.catchall.resources.datasets.requests.DeleteDatasetRequest;
import com.newscatcher.catchall.resources.datasets.requests.GetDatasetRequest;
import com.newscatcher.catchall.resources.datasets.requests.GetDatasetStatusHistoryRequest;
+import com.newscatcher.catchall.resources.datasets.requests.ListDatasetEntitiesRequest;
import com.newscatcher.catchall.resources.datasets.requests.ListDatasetsRequest;
-import com.newscatcher.catchall.resources.datasets.requests.ListEntitiesInDatasetRequest;
import com.newscatcher.catchall.resources.datasets.requests.RemoveEntitiesFromDatasetRequest;
import com.newscatcher.catchall.resources.datasets.requests.UpdateDatasetRequest;
import com.newscatcher.catchall.resources.datasets.requests.UploadCsvToDatasetRequest;
@@ -63,36 +63,28 @@ public AsyncRawDatasetsClient(ClientOptions clientOptions) {
}
/**
- * Returns a paginated list of datasets belonging to the authenticated
- * organization. Supports filtering by status and sorting by name,
- * status, or creation date.
+ * Returns a paginated list of datasets belonging to the authenticated organization. Supports filtering by status and sorting by name, status, or creation date.
*/
public CompletableFuture> listDatasets() {
return listDatasets(ListDatasetsRequest.builder().build());
}
/**
- * Returns a paginated list of datasets belonging to the authenticated
- * organization. Supports filtering by status and sorting by name,
- * status, or creation date.
+ * Returns a paginated list of datasets belonging to the authenticated organization. Supports filtering by status and sorting by name, status, or creation date.
*/
public CompletableFuture> listDatasets(RequestOptions requestOptions) {
return listDatasets(ListDatasetsRequest.builder().build(), requestOptions);
}
/**
- * Returns a paginated list of datasets belonging to the authenticated
- * organization. Supports filtering by status and sorting by name,
- * status, or creation date.
+ * Returns a paginated list of datasets belonging to the authenticated organization. Supports filtering by status and sorting by name, status, or creation date.
*/
public CompletableFuture> listDatasets(ListDatasetsRequest request) {
return listDatasets(request, null);
}
/**
- * Returns a paginated list of datasets belonging to the authenticated
- * organization. Supports filtering by status and sorting by name,
- * status, or creation date.
+ * Returns a paginated list of datasets belonging to the authenticated organization. Supports filtering by status and sorting by name, status, or creation date.
*/
public CompletableFuture> listDatasets(
ListDatasetsRequest request, RequestOptions requestOptions) {
@@ -280,9 +272,7 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) {
}
/**
- * Creates a new dataset by uploading a CSV file. Each row in the CSV
- * becomes an entity. The name column is required; all other columns
- * are optional.
+ * Creates a new dataset by uploading a CSV file. Each row in the CSV becomes an entity. The name and domaincolumns are required; all other columns are optional.
* CSV format:
* name,description,domain,alternative_names,key_persons
* NewsCatcher,"AI-powered news data provider",newscatcherapi.com,"NC;NewsCatcher API","Artem Bugara;Maksym Sugonyaka"
@@ -297,9 +287,7 @@ public CompletableFuture> crea
}
/**
- * Creates a new dataset by uploading a CSV file. Each row in the CSV
- * becomes an entity. The name column is required; all other columns
- * are optional.
+ * Creates a new dataset by uploading a CSV file. Each row in the CSV becomes an entity. The name and domaincolumns are required; all other columns are optional.
* CSV format:
* name,description,domain,alternative_names,key_persons
* NewsCatcher,"AI-powered news data provider",newscatcherapi.com,"NC;NewsCatcher API","Artem Bugara;Maksym Sugonyaka"
@@ -945,85 +933,47 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) {
}
/**
- * Returns a paginated list of entities in a dataset. Supports filtering by status and entity type.
- */
- public CompletableFuture> listEntitiesInDataset(
- String datasetId) {
- return listEntitiesInDataset(
- datasetId, ListEntitiesInDatasetRequest.builder().build());
- }
-
- /**
- * Returns a paginated list of entities in a dataset. Supports filtering by status and entity type.
- */
- public CompletableFuture> listEntitiesInDataset(
- String datasetId, RequestOptions requestOptions) {
- return listEntitiesInDataset(
- datasetId, ListEntitiesInDatasetRequest.builder().build(), requestOptions);
- }
-
- /**
- * Returns a paginated list of entities in a dataset. Supports filtering by status and entity type.
+ * Adds one or more existing entities to a dataset. Returns the number of entities added.
*/
- public CompletableFuture> listEntitiesInDataset(
- String datasetId, ListEntitiesInDatasetRequest request) {
- return listEntitiesInDataset(datasetId, request, null);
+ public CompletableFuture> addEntitiesToDataset(
+ String datasetId, AddEntitiesToDatasetRequest request) {
+ return addEntitiesToDataset(datasetId, request, null);
}
/**
- * Returns a paginated list of entities in a dataset. Supports filtering by status and entity type.
+ * Adds one or more existing entities to a dataset. Returns the number of entities added.
*/
- public CompletableFuture> listEntitiesInDataset(
- String datasetId, ListEntitiesInDatasetRequest request, RequestOptions requestOptions) {
+ public CompletableFuture> addEntitiesToDataset(
+ String datasetId, AddEntitiesToDatasetRequest request, RequestOptions requestOptions) {
HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
.addPathSegments("catchAll/datasets")
.addPathSegment(datasetId)
.addPathSegments("entities");
- if (request.getPage().isPresent()) {
- QueryStringMapper.addQueryParameter(
- httpUrl, "page", request.getPage().get(), false);
- }
- if (request.getPageSize().isPresent()) {
- QueryStringMapper.addQueryParameter(
- httpUrl, "page_size", request.getPageSize().get(), false);
- }
- if (request.getSearch().isPresent()) {
- QueryStringMapper.addQueryParameter(
- httpUrl, "search", request.getSearch().get(), false);
- }
- if (request.getStatus().isPresent()) {
- QueryStringMapper.addQueryParameter(
- httpUrl, "status", request.getStatus().get(), false);
- }
- if (request.getEntityType().isPresent()) {
- QueryStringMapper.addQueryParameter(
- httpUrl, "entity_type", request.getEntityType().get(), false);
- }
- if (request.getSortBy().isPresent()) {
- QueryStringMapper.addQueryParameter(
- httpUrl, "sort_by", request.getSortBy().get(), false);
- }
- if (request.getSortOrder().isPresent()) {
- QueryStringMapper.addQueryParameter(
- httpUrl, "sort_order", request.getSortOrder().get(), false);
- }
if (requestOptions != null) {
requestOptions.getQueryParameters().forEach((_key, _value) -> {
httpUrl.addQueryParameter(_key, _value);
});
}
- Request.Builder _requestBuilder = new Request.Builder()
+ RequestBody body;
+ try {
+ body = RequestBody.create(
+ ObjectMappers.JSON_MAPPER.writeValueAsBytes(request.getBody()), MediaTypes.APPLICATION_JSON);
+ } catch (JsonProcessingException e) {
+ throw new CatchAllApiException("Failed to serialize request", e);
+ }
+ Request okhttpRequest = new Request.Builder()
.url(httpUrl.build())
- .method("GET", null)
+ .method("POST", body)
.headers(Headers.of(clientOptions.headers(requestOptions)))
- .addHeader("Accept", "application/json");
- Request okhttpRequest = _requestBuilder.build();
+ .addHeader("Content-Type", "application/json")
+ .addHeader("Accept", "application/json")
+ .build();
OkHttpClient client = clientOptions.httpClient();
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
- CompletableFuture> future = new CompletableFuture<>();
+ CompletableFuture> future = new CompletableFuture<>();
client.newCall(okhttpRequest).enqueue(new Callback() {
@Override
public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException {
@@ -1031,8 +981,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO
String responseBodyString = responseBody != null ? responseBody.string() : "{}";
if (response.isSuccessful()) {
future.complete(new CatchAllApiHttpResponse<>(
- ObjectMappers.JSON_MAPPER.readValue(
- responseBodyString, DatasetEntityListResponse.class),
+ ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ManageEntitiesResponse.class),
response));
return;
}
@@ -1048,6 +997,12 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO
ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class),
response));
return;
+ case 422:
+ future.completeExceptionally(new UnprocessableEntityError(
+ ObjectMappers.JSON_MAPPER.readValue(
+ responseBodyString, ValidationErrorResponse.class),
+ response));
+ return;
}
} catch (JsonProcessingException ignored) {
// unable to map error response, throwing generic error
@@ -1070,18 +1025,18 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) {
}
/**
- * Adds one or more existing entities to a dataset. Returns the number of entities added.
+ * Removes one or more entities from a dataset. The entities themselves are not deleted — they are only removed from this dataset. Returns the number of entities removed.
*/
- public CompletableFuture> addEntitiesToDataset(
- String datasetId, AddEntitiesToDatasetRequest request) {
- return addEntitiesToDataset(datasetId, request, null);
+ public CompletableFuture> removeEntitiesFromDataset(
+ String datasetId, RemoveEntitiesFromDatasetRequest request) {
+ return removeEntitiesFromDataset(datasetId, request, null);
}
/**
- * Adds one or more existing entities to a dataset. Returns the number of entities added.
+ * Removes one or more entities from a dataset. The entities themselves are not deleted — they are only removed from this dataset. Returns the number of entities removed.
*/
- public CompletableFuture> addEntitiesToDataset(
- String datasetId, AddEntitiesToDatasetRequest request, RequestOptions requestOptions) {
+ public CompletableFuture> removeEntitiesFromDataset(
+ String datasetId, RemoveEntitiesFromDatasetRequest request, RequestOptions requestOptions) {
HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
.addPathSegments("catchAll/datasets")
@@ -1101,7 +1056,7 @@ public CompletableFuture> addEnt
}
Request okhttpRequest = new Request.Builder()
.url(httpUrl.build())
- .method("POST", body)
+ .method("DELETE", body)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Content-Type", "application/json")
.addHeader("Accept", "application/json")
@@ -1162,27 +1117,42 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) {
}
/**
- * Removes one or more entities from a dataset. The entities themselves
- * are not deleted — they are only removed from this dataset. Returns
- * the number of entities removed.
+ * Returns a paginated list of entities in a dataset. Supports filtering by status, entity type, and name search.
*/
- public CompletableFuture> removeEntitiesFromDataset(
- String datasetId, RemoveEntitiesFromDatasetRequest request) {
- return removeEntitiesFromDataset(datasetId, request, null);
+ public CompletableFuture> listEntitiesInDataset(
+ String datasetId) {
+ return listEntitiesInDataset(
+ datasetId, ListDatasetEntitiesRequest.builder().build());
}
/**
- * Removes one or more entities from a dataset. The entities themselves
- * are not deleted — they are only removed from this dataset. Returns
- * the number of entities removed.
+ * Returns a paginated list of entities in a dataset. Supports filtering by status, entity type, and name search.
*/
- public CompletableFuture> removeEntitiesFromDataset(
- String datasetId, RemoveEntitiesFromDatasetRequest request, RequestOptions requestOptions) {
+ public CompletableFuture> listEntitiesInDataset(
+ String datasetId, RequestOptions requestOptions) {
+ return listEntitiesInDataset(
+ datasetId, ListDatasetEntitiesRequest.builder().build(), requestOptions);
+ }
+
+ /**
+ * Returns a paginated list of entities in a dataset. Supports filtering by status, entity type, and name search.
+ */
+ public CompletableFuture> listEntitiesInDataset(
+ String datasetId, ListDatasetEntitiesRequest request) {
+ return listEntitiesInDataset(datasetId, request, null);
+ }
+
+ /**
+ * Returns a paginated list of entities in a dataset. Supports filtering by status, entity type, and name search.
+ */
+ public CompletableFuture> listEntitiesInDataset(
+ String datasetId, ListDatasetEntitiesRequest request, RequestOptions requestOptions) {
HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
.addPathSegments("catchAll/datasets")
.addPathSegment(datasetId)
- .addPathSegments("entities");
+ .addPathSegments("entities")
+ .addPathSegments("list");
if (requestOptions != null) {
requestOptions.getQueryParameters().forEach((_key, _value) -> {
httpUrl.addQueryParameter(_key, _value);
@@ -1191,13 +1161,13 @@ public CompletableFuture> remove
RequestBody body;
try {
body = RequestBody.create(
- ObjectMappers.JSON_MAPPER.writeValueAsBytes(request.getBody()), MediaTypes.APPLICATION_JSON);
+ ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON);
} catch (JsonProcessingException e) {
throw new CatchAllApiException("Failed to serialize request", e);
}
Request okhttpRequest = new Request.Builder()
.url(httpUrl.build())
- .method("DELETE", body)
+ .method("POST", body)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Content-Type", "application/json")
.addHeader("Accept", "application/json")
@@ -1206,7 +1176,7 @@ public CompletableFuture> remove
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
- CompletableFuture> future = new CompletableFuture<>();
+ CompletableFuture> future = new CompletableFuture<>();
client.newCall(okhttpRequest).enqueue(new Callback() {
@Override
public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException {
@@ -1214,7 +1184,8 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO
String responseBodyString = responseBody != null ? responseBody.string() : "{}";
if (response.isSuccessful()) {
future.complete(new CatchAllApiHttpResponse<>(
- ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ManageEntitiesResponse.class),
+ ObjectMappers.JSON_MAPPER.readValue(
+ responseBodyString, DatasetEntityListResponse.class),
response));
return;
}
@@ -1258,8 +1229,7 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) {
}
/**
- * Returns the full status change history for a dataset, ordered
- * chronologically from oldest to newest.
+ * Returns the full status change history for a dataset, ordered chronologically from oldest to newest.
*/
public CompletableFuture> getDatasetStatusHistory(
String datasetId) {
@@ -1268,8 +1238,7 @@ public CompletableFuture>
}
/**
- * Returns the full status change history for a dataset, ordered
- * chronologically from oldest to newest.
+ * Returns the full status change history for a dataset, ordered chronologically from oldest to newest.
*/
public CompletableFuture> getDatasetStatusHistory(
String datasetId, RequestOptions requestOptions) {
@@ -1278,8 +1247,7 @@ public CompletableFuture>
}
/**
- * Returns the full status change history for a dataset, ordered
- * chronologically from oldest to newest.
+ * Returns the full status change history for a dataset, ordered chronologically from oldest to newest.
*/
public CompletableFuture> getDatasetStatusHistory(
String datasetId, GetDatasetStatusHistoryRequest request) {
@@ -1287,8 +1255,7 @@ public CompletableFuture>
}
/**
- * Returns the full status change history for a dataset, ordered
- * chronologically from oldest to newest.
+ * Returns the full status change history for a dataset, ordered chronologically from oldest to newest.
*/
public CompletableFuture> getDatasetStatusHistory(
String datasetId, GetDatasetStatusHistoryRequest request, RequestOptions requestOptions) {
@@ -1359,10 +1326,8 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) {
}
/**
- * Appends new companies to an existing dataset by uploading a CSV file.
- * Uses the same CSV format as the dataset creation endpoint.
- * The response omits dataset_name compared to the create-from-CSV
- * endpoint since the dataset already exists.
+ * Appends new companies to an existing dataset by uploading a CSV file. Uses the same CSV format as the dataset creation endpoint.
+ * The response omits dataset_name compared to the create-from-CSV endpoint since the dataset already exists.
*/
public CompletableFuture> uploadCsvToDataset(
String datasetId, File file, UploadCsvToDatasetRequest request) {
@@ -1370,10 +1335,8 @@ public CompletableFuture> up
}
/**
- * Appends new companies to an existing dataset by uploading a CSV file.
- * Uses the same CSV format as the dataset creation endpoint.
- * The response omits dataset_name compared to the create-from-CSV
- * endpoint since the dataset already exists.
+ * Appends new companies to an existing dataset by uploading a CSV file. Uses the same CSV format as the dataset creation endpoint.
+ * The response omits dataset_name compared to the create-from-CSV endpoint since the dataset already exists.
*/
public CompletableFuture> uploadCsvToDataset(
String datasetId, File file, UploadCsvToDatasetRequest request, RequestOptions requestOptions) {
diff --git a/src/main/java/com/newscatcher/catchall/resources/datasets/DatasetsClient.java b/src/main/java/com/newscatcher/catchall/resources/datasets/DatasetsClient.java
index e6e63f4..21441d1 100644
--- a/src/main/java/com/newscatcher/catchall/resources/datasets/DatasetsClient.java
+++ b/src/main/java/com/newscatcher/catchall/resources/datasets/DatasetsClient.java
@@ -11,8 +11,8 @@
import com.newscatcher.catchall.resources.datasets.requests.DeleteDatasetRequest;
import com.newscatcher.catchall.resources.datasets.requests.GetDatasetRequest;
import com.newscatcher.catchall.resources.datasets.requests.GetDatasetStatusHistoryRequest;
+import com.newscatcher.catchall.resources.datasets.requests.ListDatasetEntitiesRequest;
import com.newscatcher.catchall.resources.datasets.requests.ListDatasetsRequest;
-import com.newscatcher.catchall.resources.datasets.requests.ListEntitiesInDatasetRequest;
import com.newscatcher.catchall.resources.datasets.requests.RemoveEntitiesFromDatasetRequest;
import com.newscatcher.catchall.resources.datasets.requests.UpdateDatasetRequest;
import com.newscatcher.catchall.resources.datasets.requests.UploadCsvToDatasetRequest;
@@ -45,36 +45,28 @@ public RawDatasetsClient withRawResponse() {
}
/**
- * Returns a paginated list of datasets belonging to the authenticated
- * organization. Supports filtering by status and sorting by name,
- * status, or creation date.
+ * Returns a paginated list of datasets belonging to the authenticated organization. Supports filtering by status and sorting by name, status, or creation date.
*/
public DatasetListResponse listDatasets() {
return this.rawClient.listDatasets().body();
}
/**
- * Returns a paginated list of datasets belonging to the authenticated
- * organization. Supports filtering by status and sorting by name,
- * status, or creation date.
+ * Returns a paginated list of datasets belonging to the authenticated organization. Supports filtering by status and sorting by name, status, or creation date.
*/
public DatasetListResponse listDatasets(RequestOptions requestOptions) {
return this.rawClient.listDatasets(requestOptions).body();
}
/**
- * Returns a paginated list of datasets belonging to the authenticated
- * organization. Supports filtering by status and sorting by name,
- * status, or creation date.
+ * Returns a paginated list of datasets belonging to the authenticated organization. Supports filtering by status and sorting by name, status, or creation date.
*/
public DatasetListResponse listDatasets(ListDatasetsRequest request) {
return this.rawClient.listDatasets(request).body();
}
/**
- * Returns a paginated list of datasets belonging to the authenticated
- * organization. Supports filtering by status and sorting by name,
- * status, or creation date.
+ * Returns a paginated list of datasets belonging to the authenticated organization. Supports filtering by status and sorting by name, status, or creation date.
*/
public DatasetListResponse listDatasets(ListDatasetsRequest request, RequestOptions requestOptions) {
return this.rawClient.listDatasets(request, requestOptions).body();
@@ -105,9 +97,7 @@ public DatasetResponse createDataset(CreateDatasetRequest request, RequestOption
}
/**
- * Creates a new dataset by uploading a CSV file. Each row in the CSV
- * becomes an entity. The name column is required; all other columns
- * are optional.
+ * Creates a new dataset by uploading a CSV file. Each row in the CSV becomes an entity. The name and domaincolumns are required; all other columns are optional.
* CSV format:
* name,description,domain,alternative_names,key_persons
* NewsCatcher,"AI-powered news data provider",newscatcherapi.com,"NC;NewsCatcher API","Artem Bugara;Maksym Sugonyaka"
@@ -121,9 +111,7 @@ public CreateDatasetCsvResponse createDatasetFromCsv(File file, CreateDatasetFro
}
/**
- * Creates a new dataset by uploading a CSV file. Each row in the CSV
- * becomes an entity. The name column is required; all other columns
- * are optional.
+ * Creates a new dataset by uploading a CSV file. Each row in the CSV becomes an entity. The name and domaincolumns are required; all other columns are optional.
* CSV format:
* name,description,domain,alternative_names,key_persons
* NewsCatcher,"AI-powered news data provider",newscatcherapi.com,"NC;NewsCatcher API","Artem Bugara;Maksym Sugonyaka"
@@ -255,94 +243,87 @@ public DatasetResponse updateDataset(
}
/**
- * Returns a paginated list of entities in a dataset. Supports filtering by status and entity type.
+ * Adds one or more existing entities to a dataset. Returns the number of entities added.
*/
- public DatasetEntityListResponse listEntitiesInDataset(String datasetId) {
- return this.rawClient.listEntitiesInDataset(datasetId).body();
+ public ManageEntitiesResponse addEntitiesToDataset(String datasetId, AddEntitiesToDatasetRequest request) {
+ return this.rawClient.addEntitiesToDataset(datasetId, request).body();
}
/**
- * Returns a paginated list of entities in a dataset. Supports filtering by status and entity type.
+ * Adds one or more existing entities to a dataset. Returns the number of entities added.
*/
- public DatasetEntityListResponse listEntitiesInDataset(String datasetId, RequestOptions requestOptions) {
- return this.rawClient.listEntitiesInDataset(datasetId, requestOptions).body();
+ public ManageEntitiesResponse addEntitiesToDataset(
+ String datasetId, AddEntitiesToDatasetRequest request, RequestOptions requestOptions) {
+ return this.rawClient
+ .addEntitiesToDataset(datasetId, request, requestOptions)
+ .body();
}
/**
- * Returns a paginated list of entities in a dataset. Supports filtering by status and entity type.
+ * Removes one or more entities from a dataset. The entities themselves are not deleted — they are only removed from this dataset. Returns the number of entities removed.
*/
- public DatasetEntityListResponse listEntitiesInDataset(String datasetId, ListEntitiesInDatasetRequest request) {
- return this.rawClient.listEntitiesInDataset(datasetId, request).body();
+ public ManageEntitiesResponse removeEntitiesFromDataset(
+ String datasetId, RemoveEntitiesFromDatasetRequest request) {
+ return this.rawClient.removeEntitiesFromDataset(datasetId, request).body();
}
/**
- * Returns a paginated list of entities in a dataset. Supports filtering by status and entity type.
+ * Removes one or more entities from a dataset. The entities themselves are not deleted — they are only removed from this dataset. Returns the number of entities removed.
*/
- public DatasetEntityListResponse listEntitiesInDataset(
- String datasetId, ListEntitiesInDatasetRequest request, RequestOptions requestOptions) {
+ public ManageEntitiesResponse removeEntitiesFromDataset(
+ String datasetId, RemoveEntitiesFromDatasetRequest request, RequestOptions requestOptions) {
return this.rawClient
- .listEntitiesInDataset(datasetId, request, requestOptions)
+ .removeEntitiesFromDataset(datasetId, request, requestOptions)
.body();
}
/**
- * Adds one or more existing entities to a dataset. Returns the number of entities added.
+ * Returns a paginated list of entities in a dataset. Supports filtering by status, entity type, and name search.
*/
- public ManageEntitiesResponse addEntitiesToDataset(String datasetId, AddEntitiesToDatasetRequest request) {
- return this.rawClient.addEntitiesToDataset(datasetId, request).body();
+ public DatasetEntityListResponse listEntitiesInDataset(String datasetId) {
+ return this.rawClient.listEntitiesInDataset(datasetId).body();
}
/**
- * Adds one or more existing entities to a dataset. Returns the number of entities added.
+ * Returns a paginated list of entities in a dataset. Supports filtering by status, entity type, and name search.
*/
- public ManageEntitiesResponse addEntitiesToDataset(
- String datasetId, AddEntitiesToDatasetRequest request, RequestOptions requestOptions) {
- return this.rawClient
- .addEntitiesToDataset(datasetId, request, requestOptions)
- .body();
+ public DatasetEntityListResponse listEntitiesInDataset(String datasetId, RequestOptions requestOptions) {
+ return this.rawClient.listEntitiesInDataset(datasetId, requestOptions).body();
}
/**
- * Removes one or more entities from a dataset. The entities themselves
- * are not deleted — they are only removed from this dataset. Returns
- * the number of entities removed.
+ * Returns a paginated list of entities in a dataset. Supports filtering by status, entity type, and name search.
*/
- public ManageEntitiesResponse removeEntitiesFromDataset(
- String datasetId, RemoveEntitiesFromDatasetRequest request) {
- return this.rawClient.removeEntitiesFromDataset(datasetId, request).body();
+ public DatasetEntityListResponse listEntitiesInDataset(String datasetId, ListDatasetEntitiesRequest request) {
+ return this.rawClient.listEntitiesInDataset(datasetId, request).body();
}
/**
- * Removes one or more entities from a dataset. The entities themselves
- * are not deleted — they are only removed from this dataset. Returns
- * the number of entities removed.
+ * Returns a paginated list of entities in a dataset. Supports filtering by status, entity type, and name search.
*/
- public ManageEntitiesResponse removeEntitiesFromDataset(
- String datasetId, RemoveEntitiesFromDatasetRequest request, RequestOptions requestOptions) {
+ public DatasetEntityListResponse listEntitiesInDataset(
+ String datasetId, ListDatasetEntitiesRequest request, RequestOptions requestOptions) {
return this.rawClient
- .removeEntitiesFromDataset(datasetId, request, requestOptions)
+ .listEntitiesInDataset(datasetId, request, requestOptions)
.body();
}
/**
- * Returns the full status change history for a dataset, ordered
- * chronologically from oldest to newest.
+ * Returns the full status change history for a dataset, ordered chronologically from oldest to newest.
*/
public DatasetStatusHistoryResponse getDatasetStatusHistory(String datasetId) {
return this.rawClient.getDatasetStatusHistory(datasetId).body();
}
/**
- * Returns the full status change history for a dataset, ordered
- * chronologically from oldest to newest.
+ * Returns the full status change history for a dataset, ordered chronologically from oldest to newest.
*/
public DatasetStatusHistoryResponse getDatasetStatusHistory(String datasetId, RequestOptions requestOptions) {
return this.rawClient.getDatasetStatusHistory(datasetId, requestOptions).body();
}
/**
- * Returns the full status change history for a dataset, ordered
- * chronologically from oldest to newest.
+ * Returns the full status change history for a dataset, ordered chronologically from oldest to newest.
*/
public DatasetStatusHistoryResponse getDatasetStatusHistory(
String datasetId, GetDatasetStatusHistoryRequest request) {
@@ -350,8 +331,7 @@ public DatasetStatusHistoryResponse getDatasetStatusHistory(
}
/**
- * Returns the full status change history for a dataset, ordered
- * chronologically from oldest to newest.
+ * Returns the full status change history for a dataset, ordered chronologically from oldest to newest.
*/
public DatasetStatusHistoryResponse getDatasetStatusHistory(
String datasetId, GetDatasetStatusHistoryRequest request, RequestOptions requestOptions) {
@@ -361,10 +341,8 @@ public DatasetStatusHistoryResponse getDatasetStatusHistory(
}
/**
- * Appends new companies to an existing dataset by uploading a CSV file.
- * Uses the same CSV format as the dataset creation endpoint.
- * The response omits dataset_name compared to the create-from-CSV
- * endpoint since the dataset already exists.
+ * Appends new companies to an existing dataset by uploading a CSV file. Uses the same CSV format as the dataset creation endpoint.
+ * The response omits dataset_name compared to the create-from-CSV endpoint since the dataset already exists.
*/
public UploadCsvToDatasetResponse uploadCsvToDataset(
String datasetId, File file, UploadCsvToDatasetRequest request) {
@@ -372,10 +350,8 @@ public UploadCsvToDatasetResponse uploadCsvToDataset(
}
/**
- * Appends new companies to an existing dataset by uploading a CSV file.
- * Uses the same CSV format as the dataset creation endpoint.
- * The response omits dataset_name compared to the create-from-CSV
- * endpoint since the dataset already exists.
+ * Appends new companies to an existing dataset by uploading a CSV file. Uses the same CSV format as the dataset creation endpoint.
+ * The response omits dataset_name compared to the create-from-CSV endpoint since the dataset already exists.
*/
public UploadCsvToDatasetResponse uploadCsvToDataset(
String datasetId, File file, UploadCsvToDatasetRequest request, RequestOptions requestOptions) {
diff --git a/src/main/java/com/newscatcher/catchall/resources/datasets/RawDatasetsClient.java b/src/main/java/com/newscatcher/catchall/resources/datasets/RawDatasetsClient.java
index e0fd5c3..f82adb3 100644
--- a/src/main/java/com/newscatcher/catchall/resources/datasets/RawDatasetsClient.java
+++ b/src/main/java/com/newscatcher/catchall/resources/datasets/RawDatasetsClient.java
@@ -23,8 +23,8 @@
import com.newscatcher.catchall.resources.datasets.requests.DeleteDatasetRequest;
import com.newscatcher.catchall.resources.datasets.requests.GetDatasetRequest;
import com.newscatcher.catchall.resources.datasets.requests.GetDatasetStatusHistoryRequest;
+import com.newscatcher.catchall.resources.datasets.requests.ListDatasetEntitiesRequest;
import com.newscatcher.catchall.resources.datasets.requests.ListDatasetsRequest;
-import com.newscatcher.catchall.resources.datasets.requests.ListEntitiesInDatasetRequest;
import com.newscatcher.catchall.resources.datasets.requests.RemoveEntitiesFromDatasetRequest;
import com.newscatcher.catchall.resources.datasets.requests.UpdateDatasetRequest;
import com.newscatcher.catchall.resources.datasets.requests.UploadCsvToDatasetRequest;
@@ -59,36 +59,28 @@ public RawDatasetsClient(ClientOptions clientOptions) {
}
/**
- * Returns a paginated list of datasets belonging to the authenticated
- * organization. Supports filtering by status and sorting by name,
- * status, or creation date.
+ * Returns a paginated list of datasets belonging to the authenticated organization. Supports filtering by status and sorting by name, status, or creation date.
*/
public CatchAllApiHttpResponse listDatasets() {
return listDatasets(ListDatasetsRequest.builder().build());
}
/**
- * Returns a paginated list of datasets belonging to the authenticated
- * organization. Supports filtering by status and sorting by name,
- * status, or creation date.
+ * Returns a paginated list of datasets belonging to the authenticated organization. Supports filtering by status and sorting by name, status, or creation date.
*/
public CatchAllApiHttpResponse listDatasets(RequestOptions requestOptions) {
return listDatasets(ListDatasetsRequest.builder().build(), requestOptions);
}
/**
- * Returns a paginated list of datasets belonging to the authenticated
- * organization. Supports filtering by status and sorting by name,
- * status, or creation date.
+ * Returns a paginated list of datasets belonging to the authenticated organization. Supports filtering by status and sorting by name, status, or creation date.
*/
public CatchAllApiHttpResponse listDatasets(ListDatasetsRequest request) {
return listDatasets(request, null);
}
/**
- * Returns a paginated list of datasets belonging to the authenticated
- * organization. Supports filtering by status and sorting by name,
- * status, or creation date.
+ * Returns a paginated list of datasets belonging to the authenticated organization. Supports filtering by status and sorting by name, status, or creation date.
*/
public CatchAllApiHttpResponse listDatasets(
ListDatasetsRequest request, RequestOptions requestOptions) {
@@ -241,9 +233,7 @@ public CatchAllApiHttpResponse createDataset(
}
/**
- * Creates a new dataset by uploading a CSV file. Each row in the CSV
- * becomes an entity. The name column is required; all other columns
- * are optional.
+ * Creates a new dataset by uploading a CSV file. Each row in the CSV becomes an entity. The name and domaincolumns are required; all other columns are optional.
* CSV format:
* name,description,domain,alternative_names,key_persons
* NewsCatcher,"AI-powered news data provider",newscatcherapi.com,"NC;NewsCatcher API","Artem Bugara;Maksym Sugonyaka"
@@ -258,9 +248,7 @@ public CatchAllApiHttpResponse createDatasetFromCsv(
}
/**
- * Creates a new dataset by uploading a CSV file. Each row in the CSV
- * becomes an entity. The name column is required; all other columns
- * are optional.
+ * Creates a new dataset by uploading a CSV file. Each row in the CSV becomes an entity. The name and domaincolumns are required; all other columns are optional.
* CSV format:
* name,description,domain,alternative_names,key_persons
* NewsCatcher,"AI-powered news data provider",newscatcherapi.com,"NC;NewsCatcher API","Artem Bugara;Maksym Sugonyaka"
@@ -759,79 +747,42 @@ public CatchAllApiHttpResponse updateDataset(
}
/**
- * Returns a paginated list of entities in a dataset. Supports filtering by status and entity type.
- */
- public CatchAllApiHttpResponse listEntitiesInDataset(String datasetId) {
- return listEntitiesInDataset(
- datasetId, ListEntitiesInDatasetRequest.builder().build());
- }
-
- /**
- * Returns a paginated list of entities in a dataset. Supports filtering by status and entity type.
- */
- public CatchAllApiHttpResponse listEntitiesInDataset(
- String datasetId, RequestOptions requestOptions) {
- return listEntitiesInDataset(
- datasetId, ListEntitiesInDatasetRequest.builder().build(), requestOptions);
- }
-
- /**
- * Returns a paginated list of entities in a dataset. Supports filtering by status and entity type.
+ * Adds one or more existing entities to a dataset. Returns the number of entities added.
*/
- public CatchAllApiHttpResponse listEntitiesInDataset(
- String datasetId, ListEntitiesInDatasetRequest request) {
- return listEntitiesInDataset(datasetId, request, null);
+ public CatchAllApiHttpResponse addEntitiesToDataset(
+ String datasetId, AddEntitiesToDatasetRequest request) {
+ return addEntitiesToDataset(datasetId, request, null);
}
/**
- * Returns a paginated list of entities in a dataset. Supports filtering by status and entity type.
+ * Adds one or more existing entities to a dataset. Returns the number of entities added.
*/
- public CatchAllApiHttpResponse listEntitiesInDataset(
- String datasetId, ListEntitiesInDatasetRequest request, RequestOptions requestOptions) {
+ public CatchAllApiHttpResponse addEntitiesToDataset(
+ String datasetId, AddEntitiesToDatasetRequest request, RequestOptions requestOptions) {
HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
.addPathSegments("catchAll/datasets")
.addPathSegment(datasetId)
.addPathSegments("entities");
- if (request.getPage().isPresent()) {
- QueryStringMapper.addQueryParameter(
- httpUrl, "page", request.getPage().get(), false);
- }
- if (request.getPageSize().isPresent()) {
- QueryStringMapper.addQueryParameter(
- httpUrl, "page_size", request.getPageSize().get(), false);
- }
- if (request.getSearch().isPresent()) {
- QueryStringMapper.addQueryParameter(
- httpUrl, "search", request.getSearch().get(), false);
- }
- if (request.getStatus().isPresent()) {
- QueryStringMapper.addQueryParameter(
- httpUrl, "status", request.getStatus().get(), false);
- }
- if (request.getEntityType().isPresent()) {
- QueryStringMapper.addQueryParameter(
- httpUrl, "entity_type", request.getEntityType().get(), false);
- }
- if (request.getSortBy().isPresent()) {
- QueryStringMapper.addQueryParameter(
- httpUrl, "sort_by", request.getSortBy().get(), false);
- }
- if (request.getSortOrder().isPresent()) {
- QueryStringMapper.addQueryParameter(
- httpUrl, "sort_order", request.getSortOrder().get(), false);
- }
if (requestOptions != null) {
requestOptions.getQueryParameters().forEach((_key, _value) -> {
httpUrl.addQueryParameter(_key, _value);
});
}
- Request.Builder _requestBuilder = new Request.Builder()
+ RequestBody body;
+ try {
+ body = RequestBody.create(
+ ObjectMappers.JSON_MAPPER.writeValueAsBytes(request.getBody()), MediaTypes.APPLICATION_JSON);
+ } catch (JsonProcessingException e) {
+ throw new CatchAllApiException("Failed to serialize request", e);
+ }
+ Request okhttpRequest = new Request.Builder()
.url(httpUrl.build())
- .method("GET", null)
+ .method("POST", body)
.headers(Headers.of(clientOptions.headers(requestOptions)))
- .addHeader("Accept", "application/json");
- Request okhttpRequest = _requestBuilder.build();
+ .addHeader("Content-Type", "application/json")
+ .addHeader("Accept", "application/json")
+ .build();
OkHttpClient client = clientOptions.httpClient();
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
@@ -841,7 +792,7 @@ public CatchAllApiHttpResponse listEntitiesInDataset(
String responseBodyString = responseBody != null ? responseBody.string() : "{}";
if (response.isSuccessful()) {
return new CatchAllApiHttpResponse<>(
- ObjectMappers.JSON_MAPPER.readValue(responseBodyString, DatasetEntityListResponse.class),
+ ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ManageEntitiesResponse.class),
response);
}
try {
@@ -852,6 +803,10 @@ public CatchAllApiHttpResponse listEntitiesInDataset(
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),
+ response);
}
} catch (JsonProcessingException ignored) {
// unable to map error response, throwing generic error
@@ -865,18 +820,18 @@ public CatchAllApiHttpResponse listEntitiesInDataset(
}
/**
- * Adds one or more existing entities to a dataset. Returns the number of entities added.
+ * Removes one or more entities from a dataset. The entities themselves are not deleted — they are only removed from this dataset. Returns the number of entities removed.
*/
- public CatchAllApiHttpResponse addEntitiesToDataset(
- String datasetId, AddEntitiesToDatasetRequest request) {
- return addEntitiesToDataset(datasetId, request, null);
+ public CatchAllApiHttpResponse removeEntitiesFromDataset(
+ String datasetId, RemoveEntitiesFromDatasetRequest request) {
+ return removeEntitiesFromDataset(datasetId, request, null);
}
/**
- * Adds one or more existing entities to a dataset. Returns the number of entities added.
+ * Removes one or more entities from a dataset. The entities themselves are not deleted — they are only removed from this dataset. Returns the number of entities removed.
*/
- public CatchAllApiHttpResponse addEntitiesToDataset(
- String datasetId, AddEntitiesToDatasetRequest request, RequestOptions requestOptions) {
+ public CatchAllApiHttpResponse removeEntitiesFromDataset(
+ String datasetId, RemoveEntitiesFromDatasetRequest request, RequestOptions requestOptions) {
HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
.addPathSegments("catchAll/datasets")
@@ -896,7 +851,7 @@ public CatchAllApiHttpResponse addEntitiesToDataset(
}
Request okhttpRequest = new Request.Builder()
.url(httpUrl.build())
- .method("POST", body)
+ .method("DELETE", body)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Content-Type", "application/json")
.addHeader("Accept", "application/json")
@@ -938,27 +893,41 @@ public CatchAllApiHttpResponse addEntitiesToDataset(
}
/**
- * Removes one or more entities from a dataset. The entities themselves
- * are not deleted — they are only removed from this dataset. Returns
- * the number of entities removed.
+ * Returns a paginated list of entities in a dataset. Supports filtering by status, entity type, and name search.
*/
- public CatchAllApiHttpResponse removeEntitiesFromDataset(
- String datasetId, RemoveEntitiesFromDatasetRequest request) {
- return removeEntitiesFromDataset(datasetId, request, null);
+ public CatchAllApiHttpResponse listEntitiesInDataset(String datasetId) {
+ return listEntitiesInDataset(
+ datasetId, ListDatasetEntitiesRequest.builder().build());
}
/**
- * Removes one or more entities from a dataset. The entities themselves
- * are not deleted — they are only removed from this dataset. Returns
- * the number of entities removed.
+ * Returns a paginated list of entities in a dataset. Supports filtering by status, entity type, and name search.
*/
- public CatchAllApiHttpResponse removeEntitiesFromDataset(
- String datasetId, RemoveEntitiesFromDatasetRequest request, RequestOptions requestOptions) {
+ public CatchAllApiHttpResponse listEntitiesInDataset(
+ String datasetId, RequestOptions requestOptions) {
+ return listEntitiesInDataset(
+ datasetId, ListDatasetEntitiesRequest.builder().build(), requestOptions);
+ }
+
+ /**
+ * Returns a paginated list of entities in a dataset. Supports filtering by status, entity type, and name search.
+ */
+ public CatchAllApiHttpResponse listEntitiesInDataset(
+ String datasetId, ListDatasetEntitiesRequest request) {
+ return listEntitiesInDataset(datasetId, request, null);
+ }
+
+ /**
+ * Returns a paginated list of entities in a dataset. Supports filtering by status, entity type, and name search.
+ */
+ public CatchAllApiHttpResponse listEntitiesInDataset(
+ String datasetId, ListDatasetEntitiesRequest request, RequestOptions requestOptions) {
HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
.addPathSegments("catchAll/datasets")
.addPathSegment(datasetId)
- .addPathSegments("entities");
+ .addPathSegments("entities")
+ .addPathSegments("list");
if (requestOptions != null) {
requestOptions.getQueryParameters().forEach((_key, _value) -> {
httpUrl.addQueryParameter(_key, _value);
@@ -967,13 +936,13 @@ public CatchAllApiHttpResponse removeEntitiesFromDataset
RequestBody body;
try {
body = RequestBody.create(
- ObjectMappers.JSON_MAPPER.writeValueAsBytes(request.getBody()), MediaTypes.APPLICATION_JSON);
+ ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON);
} catch (JsonProcessingException e) {
throw new CatchAllApiException("Failed to serialize request", e);
}
Request okhttpRequest = new Request.Builder()
.url(httpUrl.build())
- .method("DELETE", body)
+ .method("POST", body)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Content-Type", "application/json")
.addHeader("Accept", "application/json")
@@ -987,7 +956,7 @@ public CatchAllApiHttpResponse removeEntitiesFromDataset
String responseBodyString = responseBody != null ? responseBody.string() : "{}";
if (response.isSuccessful()) {
return new CatchAllApiHttpResponse<>(
- ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ManageEntitiesResponse.class),
+ ObjectMappers.JSON_MAPPER.readValue(responseBodyString, DatasetEntityListResponse.class),
response);
}
try {
@@ -1015,8 +984,7 @@ public CatchAllApiHttpResponse removeEntitiesFromDataset
}
/**
- * Returns the full status change history for a dataset, ordered
- * chronologically from oldest to newest.
+ * Returns the full status change history for a dataset, ordered chronologically from oldest to newest.
*/
public CatchAllApiHttpResponse getDatasetStatusHistory(String datasetId) {
return getDatasetStatusHistory(
@@ -1024,8 +992,7 @@ public CatchAllApiHttpResponse getDatasetStatusHis
}
/**
- * Returns the full status change history for a dataset, ordered
- * chronologically from oldest to newest.
+ * Returns the full status change history for a dataset, ordered chronologically from oldest to newest.
*/
public CatchAllApiHttpResponse getDatasetStatusHistory(
String datasetId, RequestOptions requestOptions) {
@@ -1034,8 +1001,7 @@ public CatchAllApiHttpResponse getDatasetStatusHis
}
/**
- * Returns the full status change history for a dataset, ordered
- * chronologically from oldest to newest.
+ * Returns the full status change history for a dataset, ordered chronologically from oldest to newest.
*/
public CatchAllApiHttpResponse getDatasetStatusHistory(
String datasetId, GetDatasetStatusHistoryRequest request) {
@@ -1043,8 +1009,7 @@ public CatchAllApiHttpResponse getDatasetStatusHis
}
/**
- * Returns the full status change history for a dataset, ordered
- * chronologically from oldest to newest.
+ * Returns the full status change history for a dataset, ordered chronologically from oldest to newest.
*/
public CatchAllApiHttpResponse getDatasetStatusHistory(
String datasetId, GetDatasetStatusHistoryRequest request, RequestOptions requestOptions) {
@@ -1097,10 +1062,8 @@ public CatchAllApiHttpResponse getDatasetStatusHis
}
/**
- * Appends new companies to an existing dataset by uploading a CSV file.
- * Uses the same CSV format as the dataset creation endpoint.
- * The response omits dataset_name compared to the create-from-CSV
- * endpoint since the dataset already exists.
+ * Appends new companies to an existing dataset by uploading a CSV file. Uses the same CSV format as the dataset creation endpoint.
+ * The response omits dataset_name compared to the create-from-CSV endpoint since the dataset already exists.
*/
public CatchAllApiHttpResponse uploadCsvToDataset(
String datasetId, File file, UploadCsvToDatasetRequest request) {
@@ -1108,10 +1071,8 @@ public CatchAllApiHttpResponse uploadCsvToDataset(
}
/**
- * Appends new companies to an existing dataset by uploading a CSV file.
- * Uses the same CSV format as the dataset creation endpoint.
- * The response omits dataset_name compared to the create-from-CSV
- * endpoint since the dataset already exists.
+ * Appends new companies to an existing dataset by uploading a CSV file. Uses the same CSV format as the dataset creation endpoint.
+ * The response omits dataset_name compared to the create-from-CSV endpoint since the dataset already exists.
*/
public CatchAllApiHttpResponse uploadCsvToDataset(
String datasetId, File file, UploadCsvToDatasetRequest request, RequestOptions requestOptions) {
diff --git a/src/main/java/com/newscatcher/catchall/resources/datasets/requests/ListEntitiesInDatasetRequest.java b/src/main/java/com/newscatcher/catchall/resources/datasets/requests/ListDatasetEntitiesRequest.java
similarity index 86%
rename from src/main/java/com/newscatcher/catchall/resources/datasets/requests/ListEntitiesInDatasetRequest.java
rename to src/main/java/com/newscatcher/catchall/resources/datasets/requests/ListDatasetEntitiesRequest.java
index 03edb9b..c5ea6e5 100644
--- a/src/main/java/com/newscatcher/catchall/resources/datasets/requests/ListEntitiesInDatasetRequest.java
+++ b/src/main/java/com/newscatcher/catchall/resources/datasets/requests/ListDatasetEntitiesRequest.java
@@ -5,9 +5,9 @@
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;
@@ -22,8 +22,8 @@
import java.util.Optional;
@JsonInclude(JsonInclude.Include.NON_ABSENT)
-@JsonDeserialize(builder = ListEntitiesInDatasetRequest.Builder.class)
-public final class ListEntitiesInDatasetRequest {
+@JsonDeserialize(builder = ListDatasetEntitiesRequest.Builder.class)
+public final class ListDatasetEntitiesRequest {
private final Optional page;
private final Optional pageSize;
@@ -40,7 +40,7 @@ public final class ListEntitiesInDatasetRequest {
private final Map additionalProperties;
- private ListEntitiesInDatasetRequest(
+ private ListDatasetEntitiesRequest(
Optional page,
Optional pageSize,
Optional search,
@@ -60,45 +60,45 @@ private ListEntitiesInDatasetRequest(
}
/**
- * @return Page number to retrieve.
+ * @return The page number to retrieve.
*/
- @JsonIgnore
+ @JsonProperty("page")
public Optional getPage() {
return page;
}
/**
- * @return Number of entities per page.
+ * @return The number of entities per page.
*/
- @JsonIgnore
+ @JsonProperty("page_size")
public Optional getPageSize() {
return pageSize;
}
/**
- * @return Filter entities by name.
+ * @return Filters entities by name using a case-insensitive substring match.
*/
- @JsonIgnore
+ @JsonProperty("search")
public Optional getSearch() {
return search;
}
- @JsonIgnore
+ @JsonProperty("status")
public Optional getStatus() {
return status;
}
- @JsonIgnore
+ @JsonProperty("entity_type")
public Optional getEntityType() {
return entityType;
}
- @JsonIgnore
+ @JsonProperty("sort_by")
public Optional getSortBy() {
return sortBy;
}
- @JsonIgnore
+ @JsonProperty("sort_order")
public Optional getSortOrder() {
return sortOrder;
}
@@ -106,7 +106,7 @@ public Optional getSortOrder() {
@java.lang.Override
public boolean equals(Object other) {
if (this == other) return true;
- return other instanceof ListEntitiesInDatasetRequest && equalTo((ListEntitiesInDatasetRequest) other);
+ return other instanceof ListDatasetEntitiesRequest && equalTo((ListDatasetEntitiesRequest) other);
}
@JsonAnyGetter
@@ -114,7 +114,7 @@ public Map getAdditionalProperties() {
return this.additionalProperties;
}
- private boolean equalTo(ListEntitiesInDatasetRequest other) {
+ private boolean equalTo(ListDatasetEntitiesRequest other) {
return page.equals(other.page)
&& pageSize.equals(other.pageSize)
&& search.equals(other.search)
@@ -160,7 +160,7 @@ public static final class Builder {
private Builder() {}
- public Builder from(ListEntitiesInDatasetRequest other) {
+ public Builder from(ListDatasetEntitiesRequest other) {
page(other.getPage());
pageSize(other.getPageSize());
search(other.getSearch());
@@ -172,7 +172,7 @@ public Builder from(ListEntitiesInDatasetRequest other) {
}
/**
- * Page number to retrieve.
+ * The page number to retrieve.
*/
@JsonSetter(value = "page", nulls = Nulls.SKIP)
public Builder page(Optional page) {
@@ -186,7 +186,7 @@ public Builder page(Integer page) {
}
/**
- * Number of entities per page.
+ * The number of entities per page.
*/
@JsonSetter(value = "page_size", nulls = Nulls.SKIP)
public Builder pageSize(Optional pageSize) {
@@ -200,7 +200,7 @@ public Builder pageSize(Integer pageSize) {
}
/**
- * Filter entities by name.
+ * Filters entities by name using a case-insensitive substring match.
*/
@JsonSetter(value = "search", nulls = Nulls.SKIP)
public Builder search(Optional search) {
@@ -257,8 +257,8 @@ public Builder sortOrder(SortOrder sortOrder) {
return this;
}
- public ListEntitiesInDatasetRequest build() {
- return new ListEntitiesInDatasetRequest(
+ public ListDatasetEntitiesRequest build() {
+ return new ListDatasetEntitiesRequest(
page, pageSize, search, status, entityType, sortBy, sortOrder, additionalProperties);
}
diff --git a/src/main/java/com/newscatcher/catchall/resources/datasets/requests/ListDatasetsRequest.java b/src/main/java/com/newscatcher/catchall/resources/datasets/requests/ListDatasetsRequest.java
index a8f0bb5..04096f5 100644
--- a/src/main/java/com/newscatcher/catchall/resources/datasets/requests/ListDatasetsRequest.java
+++ b/src/main/java/com/newscatcher/catchall/resources/datasets/requests/ListDatasetsRequest.java
@@ -5,9 +5,9 @@
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;
@@ -62,7 +62,7 @@ private ListDatasetsRequest(
/**
* @return Page number to retrieve.
*/
- @JsonIgnore
+ @JsonProperty("page")
public Optional getPage() {
return page;
}
@@ -70,7 +70,7 @@ public Optional getPage() {
/**
* @return Number of datasets per page.
*/
- @JsonIgnore
+ @JsonProperty("page_size")
public Optional getPageSize() {
return pageSize;
}
@@ -78,7 +78,7 @@ public Optional getPageSize() {
/**
* @return Filter datasets by name (case-insensitive substring match).
*/
- @JsonIgnore
+ @JsonProperty("search")
public Optional getSearch() {
return search;
}
@@ -86,25 +86,22 @@ public Optional getSearch() {
/**
* @return Filter by dataset status.
*/
- @JsonIgnore
+ @JsonProperty("latest_status")
public Optional getLatestStatus() {
return latestStatus;
}
- @JsonIgnore
+ @JsonProperty("sort_by")
public Optional getSortBy() {
return sortBy;
}
- @JsonIgnore
+ @JsonProperty("sort_order")
public Optional getSortOrder() {
return sortOrder;
}
- /**
- * @return Filter results by ownership. Defaults to all.
- */
- @JsonIgnore
+ @JsonProperty("ownership")
public Optional getOwnership() {
return ownership;
}
@@ -255,9 +252,6 @@ public Builder sortOrder(SortOrder sortOrder) {
return this;
}
- /**
- * Filter results by ownership. Defaults to all.
- */
@JsonSetter(value = "ownership", nulls = Nulls.SKIP)
public Builder ownership(Optional ownership) {
this.ownership = ownership;
diff --git a/src/main/java/com/newscatcher/catchall/resources/entities/AsyncEntitiesClient.java b/src/main/java/com/newscatcher/catchall/resources/entities/AsyncEntitiesClient.java
index 3812997..9fd8ca3 100644
--- a/src/main/java/com/newscatcher/catchall/resources/entities/AsyncEntitiesClient.java
+++ b/src/main/java/com/newscatcher/catchall/resources/entities/AsyncEntitiesClient.java
@@ -35,36 +35,28 @@ public AsyncRawEntitiesClient withRawResponse() {
}
/**
- * Returns a paginated list of entities belonging to the authenticated
- * organization. Supports filtering by status and entity type, and
- * sorting by name, status, or creation date.
+ * Returns a paginated list of entities belonging to the authenticated organization. Supports filtering by status and entity type, and sorting by name, status, or creation date.
*/
public CompletableFuture listEntities() {
return this.rawClient.listEntities().thenApply(response -> response.body());
}
/**
- * Returns a paginated list of entities belonging to the authenticated
- * organization. Supports filtering by status and entity type, and
- * sorting by name, status, or creation date.
+ * Returns a paginated list of entities belonging to the authenticated organization. Supports filtering by status and entity type, and sorting by name, status, or creation date.
*/
public CompletableFuture listEntities(RequestOptions requestOptions) {
return this.rawClient.listEntities(requestOptions).thenApply(response -> response.body());
}
/**
- * Returns a paginated list of entities belonging to the authenticated
- * organization. Supports filtering by status and entity type, and
- * sorting by name, status, or creation date.
+ * Returns a paginated list of entities belonging to the authenticated organization. Supports filtering by status and entity type, and sorting by name, status, or creation date.
*/
public CompletableFuture listEntities(ListEntitiesRequest request) {
return this.rawClient.listEntities(request).thenApply(response -> response.body());
}
/**
- * Returns a paginated list of entities belonging to the authenticated
- * organization. Supports filtering by status and entity type, and
- * sorting by name, status, or creation date.
+ * Returns a paginated list of entities belonging to the authenticated organization. Supports filtering by status and entity type, and sorting by name, status, or creation date.
*/
public CompletableFuture listEntities(
ListEntitiesRequest request, RequestOptions requestOptions) {
@@ -95,20 +87,16 @@ public CompletableFuture createEntity(
}
/**
- * Creates multiple entities in a single request. Each entity is
- * processed independently — a failure in one does not affect others.
- * Returns an array of {id, status} objects in the same order as
- * the input array.
+ * Creates multiple entities in a single request. Each entity is processed independently — a failure in one does not affect others.
+ * Returns an array of {id, status} objects in the same order as the input array.
*/
public CompletableFuture createEntitiesBatch(CreateEntitiesBatchRequest request) {
return this.rawClient.createEntitiesBatch(request).thenApply(response -> response.body());
}
/**
- * Creates multiple entities in a single request. Each entity is
- * processed independently — a failure in one does not affect others.
- * Returns an array of {id, status} objects in the same order as
- * the input array.
+ * Creates multiple entities in a single request. Each entity is processed independently — a failure in one does not affect others.
+ * Returns an array of {id, status} objects in the same order as the input array.
*/
public CompletableFuture createEntitiesBatch(
CreateEntitiesBatchRequest request, RequestOptions requestOptions) {
diff --git a/src/main/java/com/newscatcher/catchall/resources/entities/AsyncRawEntitiesClient.java b/src/main/java/com/newscatcher/catchall/resources/entities/AsyncRawEntitiesClient.java
index c435149..6e98da9 100644
--- a/src/main/java/com/newscatcher/catchall/resources/entities/AsyncRawEntitiesClient.java
+++ b/src/main/java/com/newscatcher/catchall/resources/entities/AsyncRawEntitiesClient.java
@@ -47,36 +47,28 @@ public AsyncRawEntitiesClient(ClientOptions clientOptions) {
}
/**
- * Returns a paginated list of entities belonging to the authenticated
- * organization. Supports filtering by status and entity type, and
- * sorting by name, status, or creation date.
+ * Returns a paginated list of entities belonging to the authenticated organization. Supports filtering by status and entity type, and sorting by name, status, or creation date.
*/
public CompletableFuture> listEntities() {
return listEntities(ListEntitiesRequest.builder().build());
}
/**
- * Returns a paginated list of entities belonging to the authenticated
- * organization. Supports filtering by status and entity type, and
- * sorting by name, status, or creation date.
+ * Returns a paginated list of entities belonging to the authenticated organization. Supports filtering by status and entity type, and sorting by name, status, or creation date.
*/
public CompletableFuture> listEntities(RequestOptions requestOptions) {
return listEntities(ListEntitiesRequest.builder().build(), requestOptions);
}
/**
- * Returns a paginated list of entities belonging to the authenticated
- * organization. Supports filtering by status and entity type, and
- * sorting by name, status, or creation date.
+ * Returns a paginated list of entities belonging to the authenticated organization. Supports filtering by status and entity type, and sorting by name, status, or creation date.
*/
public CompletableFuture> listEntities(ListEntitiesRequest request) {
return listEntities(request, null);
}
/**
- * Returns a paginated list of entities belonging to the authenticated
- * organization. Supports filtering by status and entity type, and
- * sorting by name, status, or creation date.
+ * Returns a paginated list of entities belonging to the authenticated organization. Supports filtering by status and entity type, and sorting by name, status, or creation date.
*/
public CompletableFuture> listEntities(
ListEntitiesRequest request, RequestOptions requestOptions) {
@@ -256,10 +248,8 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) {
}
/**
- * Creates multiple entities in a single request. Each entity is
- * processed independently — a failure in one does not affect others.
- * Returns an array of {id, status} objects in the same order as
- * the input array.
+ * Creates multiple entities in a single request. Each entity is processed independently — a failure in one does not affect others.
+ * Returns an array of {id, status} objects in the same order as the input array.
*/
public CompletableFuture> createEntitiesBatch(
CreateEntitiesBatchRequest request) {
@@ -267,10 +257,8 @@ public CompletableFuture> c
}
/**
- * Creates multiple entities in a single request. Each entity is
- * processed independently — a failure in one does not affect others.
- * Returns an array of {id, status} objects in the same order as
- * the input array.
+ * Creates multiple entities in a single request. Each entity is processed independently — a failure in one does not affect others.
+ * Returns an array of {id, status} objects in the same order as the input array.
*/
public CompletableFuture> createEntitiesBatch(
CreateEntitiesBatchRequest request, RequestOptions requestOptions) {
diff --git a/src/main/java/com/newscatcher/catchall/resources/entities/EntitiesClient.java b/src/main/java/com/newscatcher/catchall/resources/entities/EntitiesClient.java
index d53f7b3..b2bf5ad 100644
--- a/src/main/java/com/newscatcher/catchall/resources/entities/EntitiesClient.java
+++ b/src/main/java/com/newscatcher/catchall/resources/entities/EntitiesClient.java
@@ -34,36 +34,28 @@ public RawEntitiesClient withRawResponse() {
}
/**
- * Returns a paginated list of entities belonging to the authenticated
- * organization. Supports filtering by status and entity type, and
- * sorting by name, status, or creation date.
+ * Returns a paginated list of entities belonging to the authenticated organization. Supports filtering by status and entity type, and sorting by name, status, or creation date.
*/
public EntityListResponse listEntities() {
return this.rawClient.listEntities().body();
}
/**
- * Returns a paginated list of entities belonging to the authenticated
- * organization. Supports filtering by status and entity type, and
- * sorting by name, status, or creation date.
+ * Returns a paginated list of entities belonging to the authenticated organization. Supports filtering by status and entity type, and sorting by name, status, or creation date.
*/
public EntityListResponse listEntities(RequestOptions requestOptions) {
return this.rawClient.listEntities(requestOptions).body();
}
/**
- * Returns a paginated list of entities belonging to the authenticated
- * organization. Supports filtering by status and entity type, and
- * sorting by name, status, or creation date.
+ * Returns a paginated list of entities belonging to the authenticated organization. Supports filtering by status and entity type, and sorting by name, status, or creation date.
*/
public EntityListResponse listEntities(ListEntitiesRequest request) {
return this.rawClient.listEntities(request).body();
}
/**
- * Returns a paginated list of entities belonging to the authenticated
- * organization. Supports filtering by status and entity type, and
- * sorting by name, status, or creation date.
+ * Returns a paginated list of entities belonging to the authenticated organization. Supports filtering by status and entity type, and sorting by name, status, or creation date.
*/
public EntityListResponse listEntities(ListEntitiesRequest request, RequestOptions requestOptions) {
return this.rawClient.listEntities(request, requestOptions).body();
@@ -92,20 +84,16 @@ public CreateEntityResponse createEntity(CreateEntityRequest request, RequestOpt
}
/**
- * Creates multiple entities in a single request. Each entity is
- * processed independently — a failure in one does not affect others.
- * Returns an array of {id, status} objects in the same order as
- * the input array.
+ * Creates multiple entities in a single request. Each entity is processed independently — a failure in one does not affect others.
+ * Returns an array of {id, status} objects in the same order as the input array.
*/
public CreateEntitiesBatchResponse createEntitiesBatch(CreateEntitiesBatchRequest request) {
return this.rawClient.createEntitiesBatch(request).body();
}
/**
- * Creates multiple entities in a single request. Each entity is
- * processed independently — a failure in one does not affect others.
- * Returns an array of {id, status} objects in the same order as
- * the input array.
+ * Creates multiple entities in a single request. Each entity is processed independently — a failure in one does not affect others.
+ * Returns an array of {id, status} objects in the same order as the input array.
*/
public CreateEntitiesBatchResponse createEntitiesBatch(
CreateEntitiesBatchRequest request, RequestOptions requestOptions) {
diff --git a/src/main/java/com/newscatcher/catchall/resources/entities/RawEntitiesClient.java b/src/main/java/com/newscatcher/catchall/resources/entities/RawEntitiesClient.java
index 26626d8..aa3f769 100644
--- a/src/main/java/com/newscatcher/catchall/resources/entities/RawEntitiesClient.java
+++ b/src/main/java/com/newscatcher/catchall/resources/entities/RawEntitiesClient.java
@@ -43,36 +43,28 @@ public RawEntitiesClient(ClientOptions clientOptions) {
}
/**
- * Returns a paginated list of entities belonging to the authenticated
- * organization. Supports filtering by status and entity type, and
- * sorting by name, status, or creation date.
+ * Returns a paginated list of entities belonging to the authenticated organization. Supports filtering by status and entity type, and sorting by name, status, or creation date.
*/
public CatchAllApiHttpResponse listEntities() {
return listEntities(ListEntitiesRequest.builder().build());
}
/**
- * Returns a paginated list of entities belonging to the authenticated
- * organization. Supports filtering by status and entity type, and
- * sorting by name, status, or creation date.
+ * Returns a paginated list of entities belonging to the authenticated organization. Supports filtering by status and entity type, and sorting by name, status, or creation date.
*/
public CatchAllApiHttpResponse listEntities(RequestOptions requestOptions) {
return listEntities(ListEntitiesRequest.builder().build(), requestOptions);
}
/**
- * Returns a paginated list of entities belonging to the authenticated
- * organization. Supports filtering by status and entity type, and
- * sorting by name, status, or creation date.
+ * Returns a paginated list of entities belonging to the authenticated organization. Supports filtering by status and entity type, and sorting by name, status, or creation date.
*/
public CatchAllApiHttpResponse listEntities(ListEntitiesRequest request) {
return listEntities(request, null);
}
/**
- * Returns a paginated list of entities belonging to the authenticated
- * organization. Supports filtering by status and entity type, and
- * sorting by name, status, or creation date.
+ * Returns a paginated list of entities belonging to the authenticated organization. Supports filtering by status and entity type, and sorting by name, status, or creation date.
*/
public CatchAllApiHttpResponse listEntities(
ListEntitiesRequest request, RequestOptions requestOptions) {
@@ -219,10 +211,8 @@ public CatchAllApiHttpResponse createEntity(
}
/**
- * Creates multiple entities in a single request. Each entity is
- * processed independently — a failure in one does not affect others.
- * Returns an array of {id, status} objects in the same order as
- * the input array.
+ * Creates multiple entities in a single request. Each entity is processed independently — a failure in one does not affect others.
+ * Returns an array of {id, status} objects in the same order as the input array.
*/
public CatchAllApiHttpResponse createEntitiesBatch(
CreateEntitiesBatchRequest request) {
@@ -230,10 +220,8 @@ public CatchAllApiHttpResponse createEntitiesBatch(
}
/**
- * Creates multiple entities in a single request. Each entity is
- * processed independently — a failure in one does not affect others.
- * Returns an array of {id, status} objects in the same order as
- * the input array.
+ * Creates multiple entities in a single request. Each entity is processed independently — a failure in one does not affect others.
+ * Returns an array of {id, status} objects in the same order as the input array.
*/
public CatchAllApiHttpResponse createEntitiesBatch(
CreateEntitiesBatchRequest request, RequestOptions requestOptions) {
diff --git a/src/main/java/com/newscatcher/catchall/resources/entities/requests/ListEntitiesRequest.java b/src/main/java/com/newscatcher/catchall/resources/entities/requests/ListEntitiesRequest.java
index 040640d..95caf83 100644
--- a/src/main/java/com/newscatcher/catchall/resources/entities/requests/ListEntitiesRequest.java
+++ b/src/main/java/com/newscatcher/catchall/resources/entities/requests/ListEntitiesRequest.java
@@ -5,9 +5,9 @@
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;
@@ -62,7 +62,7 @@ private ListEntitiesRequest(
/**
* @return Page number to retrieve.
*/
- @JsonIgnore
+ @JsonProperty("page")
public Optional getPage() {
return page;
}
@@ -70,7 +70,7 @@ public Optional getPage() {
/**
* @return Number of entities per page.
*/
- @JsonIgnore
+ @JsonProperty("page_size")
public Optional getPageSize() {
return pageSize;
}
@@ -78,27 +78,27 @@ public Optional getPageSize() {
/**
* @return Filter entities by name (case-insensitive substring match).
*/
- @JsonIgnore
+ @JsonProperty("search")
public Optional getSearch() {
return search;
}
- @JsonIgnore
+ @JsonProperty("status")
public Optional getStatus() {
return status;
}
- @JsonIgnore
+ @JsonProperty("entity_type")
public Optional getEntityType() {
return entityType;
}
- @JsonIgnore
+ @JsonProperty("sort_by")
public Optional getSortBy() {
return sortBy;
}
- @JsonIgnore
+ @JsonProperty("sort_order")
public Optional getSortOrder() {
return sortOrder;
}
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 8500708..b62d853 100644
--- a/src/main/java/com/newscatcher/catchall/resources/jobs/AsyncJobsClient.java
+++ b/src/main/java/com/newscatcher/catchall/resources/jobs/AsyncJobsClient.java
@@ -170,10 +170,8 @@ public CompletableFuture continueJob(
}
/**
- * Soft-deletes a job. The job is flagged as deleted and no longer
- * appears in list results. The underlying data is retained.
- * Only the job owner can delete a job. Returns 404 if the job is not
- * found or does not belong to the authenticated user.
+ * Soft-deletes a job. The job is flagged as deleted and no longer appears in list results. The underlying data is retained.
+ * Only the job owner can delete a job. Returns 404 if the job is not found or does not belong to the authenticated user.
* Deleting an already-deleted job returns 200.
*/
public CompletableFuture deleteJob(String jobId) {
@@ -181,10 +179,8 @@ public CompletableFuture deleteJob(String jobId) {
}
/**
- * Soft-deletes a job. The job is flagged as deleted and no longer
- * appears in list results. The underlying data is retained.
- * Only the job owner can delete a job. Returns 404 if the job is not
- * found or does not belong to the authenticated user.
+ * Soft-deletes a job. The job is flagged as deleted and no longer appears in list results. The underlying data is retained.
+ * Only the job owner can delete a job. Returns 404 if the job is not found or does not belong to the authenticated user.
* Deleting an already-deleted job returns 200.
*/
public CompletableFuture deleteJob(String jobId, RequestOptions requestOptions) {
@@ -192,10 +188,8 @@ public CompletableFuture deleteJob(String jobId, RequestOp
}
/**
- * Soft-deletes a job. The job is flagged as deleted and no longer
- * appears in list results. The underlying data is retained.
- * Only the job owner can delete a job. Returns 404 if the job is not
- * found or does not belong to the authenticated user.
+ * Soft-deletes a job. The job is flagged as deleted and no longer appears in list results. The underlying data is retained.
+ * Only the job owner can delete a job. Returns 404 if the job is not found or does not belong to the authenticated user.
* Deleting an already-deleted job returns 200.
*/
public CompletableFuture deleteJob(String jobId, DeleteJobRequest request) {
@@ -203,10 +197,8 @@ public CompletableFuture deleteJob(String jobId, DeleteJob
}
/**
- * Soft-deletes a job. The job is flagged as deleted and no longer
- * appears in list results. The underlying data is retained.
- * Only the job owner can delete a job. Returns 404 if the job is not
- * found or does not belong to the authenticated user.
+ * Soft-deletes a job. The job is flagged as deleted and no longer appears in list results. The underlying data is retained.
+ * Only the job owner can delete a job. Returns 404 if the job is not found or does not belong to the authenticated user.
* Deleting an already-deleted job returns 200.
*/
public CompletableFuture deleteJob(
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 5ed94fe..a24dab1 100644
--- a/src/main/java/com/newscatcher/catchall/resources/jobs/AsyncRawJobsClient.java
+++ b/src/main/java/com/newscatcher/catchall/resources/jobs/AsyncRawJobsClient.java
@@ -607,10 +607,8 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) {
}
/**
- * Soft-deletes a job. The job is flagged as deleted and no longer
- * appears in list results. The underlying data is retained.
- * Only the job owner can delete a job. Returns 404 if the job is not
- * found or does not belong to the authenticated user.
+ * Soft-deletes a job. The job is flagged as deleted and no longer appears in list results. The underlying data is retained.
+ * Only the job owner can delete a job. Returns 404 if the job is not found or does not belong to the authenticated user.
* Deleting an already-deleted job returns 200.
*/
public CompletableFuture> deleteJob(String jobId) {
@@ -618,10 +616,8 @@ public CompletableFuture> deleteJo
}
/**
- * Soft-deletes a job. The job is flagged as deleted and no longer
- * appears in list results. The underlying data is retained.
- * Only the job owner can delete a job. Returns 404 if the job is not
- * found or does not belong to the authenticated user.
+ * Soft-deletes a job. The job is flagged as deleted and no longer appears in list results. The underlying data is retained.
+ * Only the job owner can delete a job. Returns 404 if the job is not found or does not belong to the authenticated user.
* Deleting an already-deleted job returns 200.
*/
public CompletableFuture> deleteJob(
@@ -630,10 +626,8 @@ public CompletableFuture> deleteJo
}
/**
- * Soft-deletes a job. The job is flagged as deleted and no longer
- * appears in list results. The underlying data is retained.
- * Only the job owner can delete a job. Returns 404 if the job is not
- * found or does not belong to the authenticated user.
+ * Soft-deletes a job. The job is flagged as deleted and no longer appears in list results. The underlying data is retained.
+ * Only the job owner can delete a job. Returns 404 if the job is not found or does not belong to the authenticated user.
* Deleting an already-deleted job returns 200.
*/
public CompletableFuture> deleteJob(
@@ -642,10 +636,8 @@ public CompletableFuture> deleteJo
}
/**
- * Soft-deletes a job. The job is flagged as deleted and no longer
- * appears in list results. The underlying data is retained.
- * Only the job owner can delete a job. Returns 404 if the job is not
- * found or does not belong to the authenticated user.
+ * Soft-deletes a job. The job is flagged as deleted and no longer appears in list results. The underlying data is retained.
+ * Only the job owner can delete a job. Returns 404 if the job is not found or does not belong to the authenticated user.
* Deleting an already-deleted job returns 200.
*/
public CompletableFuture> deleteJob(
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 b39f706..99f2da8 100644
--- a/src/main/java/com/newscatcher/catchall/resources/jobs/JobsClient.java
+++ b/src/main/java/com/newscatcher/catchall/resources/jobs/JobsClient.java
@@ -164,10 +164,8 @@ public ContinueResponseDto continueJob(ContinueRequestDto request, RequestOption
}
/**
- * Soft-deletes a job. The job is flagged as deleted and no longer
- * appears in list results. The underlying data is retained.
- * Only the job owner can delete a job. Returns 404 if the job is not
- * found or does not belong to the authenticated user.
+ * Soft-deletes a job. The job is flagged as deleted and no longer appears in list results. The underlying data is retained.
+ * Only the job owner can delete a job. Returns 404 if the job is not found or does not belong to the authenticated user.
* Deleting an already-deleted job returns 200.
*/
public DeleteJobResponseDto deleteJob(String jobId) {
@@ -175,10 +173,8 @@ public DeleteJobResponseDto deleteJob(String jobId) {
}
/**
- * Soft-deletes a job. The job is flagged as deleted and no longer
- * appears in list results. The underlying data is retained.
- * Only the job owner can delete a job. Returns 404 if the job is not
- * found or does not belong to the authenticated user.
+ * Soft-deletes a job. The job is flagged as deleted and no longer appears in list results. The underlying data is retained.
+ * Only the job owner can delete a job. Returns 404 if the job is not found or does not belong to the authenticated user.
* Deleting an already-deleted job returns 200.
*/
public DeleteJobResponseDto deleteJob(String jobId, RequestOptions requestOptions) {
@@ -186,10 +182,8 @@ public DeleteJobResponseDto deleteJob(String jobId, RequestOptions requestOption
}
/**
- * Soft-deletes a job. The job is flagged as deleted and no longer
- * appears in list results. The underlying data is retained.
- * Only the job owner can delete a job. Returns 404 if the job is not
- * found or does not belong to the authenticated user.
+ * Soft-deletes a job. The job is flagged as deleted and no longer appears in list results. The underlying data is retained.
+ * Only the job owner can delete a job. Returns 404 if the job is not found or does not belong to the authenticated user.
* Deleting an already-deleted job returns 200.
*/
public DeleteJobResponseDto deleteJob(String jobId, DeleteJobRequest request) {
@@ -197,10 +191,8 @@ public DeleteJobResponseDto deleteJob(String jobId, DeleteJobRequest request) {
}
/**
- * Soft-deletes a job. The job is flagged as deleted and no longer
- * appears in list results. The underlying data is retained.
- * Only the job owner can delete a job. Returns 404 if the job is not
- * found or does not belong to the authenticated user.
+ * Soft-deletes a job. The job is flagged as deleted and no longer appears in list results. The underlying data is retained.
+ * Only the job owner can delete a job. Returns 404 if the job is not found or does not belong to the authenticated user.
* Deleting an already-deleted job returns 200.
*/
public DeleteJobResponseDto deleteJob(String jobId, DeleteJobRequest request, RequestOptions requestOptions) {
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 fde4972..2a2c7f7 100644
--- a/src/main/java/com/newscatcher/catchall/resources/jobs/RawJobsClient.java
+++ b/src/main/java/com/newscatcher/catchall/resources/jobs/RawJobsClient.java
@@ -490,10 +490,8 @@ public CatchAllApiHttpResponse continueJob(
}
/**
- * Soft-deletes a job. The job is flagged as deleted and no longer
- * appears in list results. The underlying data is retained.
- * Only the job owner can delete a job. Returns 404 if the job is not
- * found or does not belong to the authenticated user.
+ * Soft-deletes a job. The job is flagged as deleted and no longer appears in list results. The underlying data is retained.
+ * Only the job owner can delete a job. Returns 404 if the job is not found or does not belong to the authenticated user.
* Deleting an already-deleted job returns 200.
*/
public CatchAllApiHttpResponse deleteJob(String jobId) {
@@ -501,10 +499,8 @@ public CatchAllApiHttpResponse deleteJob(String jobId) {
}
/**
- * Soft-deletes a job. The job is flagged as deleted and no longer
- * appears in list results. The underlying data is retained.
- * Only the job owner can delete a job. Returns 404 if the job is not
- * found or does not belong to the authenticated user.
+ * Soft-deletes a job. The job is flagged as deleted and no longer appears in list results. The underlying data is retained.
+ * Only the job owner can delete a job. Returns 404 if the job is not found or does not belong to the authenticated user.
* Deleting an already-deleted job returns 200.
*/
public CatchAllApiHttpResponse deleteJob(String jobId, RequestOptions requestOptions) {
@@ -512,10 +508,8 @@ public CatchAllApiHttpResponse deleteJob(String jobId, Req
}
/**
- * Soft-deletes a job. The job is flagged as deleted and no longer
- * appears in list results. The underlying data is retained.
- * Only the job owner can delete a job. Returns 404 if the job is not
- * found or does not belong to the authenticated user.
+ * Soft-deletes a job. The job is flagged as deleted and no longer appears in list results. The underlying data is retained.
+ * Only the job owner can delete a job. Returns 404 if the job is not found or does not belong to the authenticated user.
* Deleting an already-deleted job returns 200.
*/
public CatchAllApiHttpResponse deleteJob(String jobId, DeleteJobRequest request) {
@@ -523,10 +517,8 @@ public CatchAllApiHttpResponse deleteJob(String jobId, Del
}
/**
- * Soft-deletes a job. The job is flagged as deleted and no longer
- * appears in list results. The underlying data is retained.
- * Only the job owner can delete a job. Returns 404 if the job is not
- * found or does not belong to the authenticated user.
+ * Soft-deletes a job. The job is flagged as deleted and no longer appears in list results. The underlying data is retained.
+ * Only the job owner can delete a job. Returns 404 if the job is not found or does not belong to the authenticated user.
* Deleting an already-deleted job returns 200.
*/
public CatchAllApiHttpResponse deleteJob(
diff --git a/src/main/java/com/newscatcher/catchall/resources/jobs/requests/GetJobResultsRequest.java b/src/main/java/com/newscatcher/catchall/resources/jobs/requests/GetJobResultsRequest.java
index 5eb2847..0a8a21d 100644
--- a/src/main/java/com/newscatcher/catchall/resources/jobs/requests/GetJobResultsRequest.java
+++ b/src/main/java/com/newscatcher/catchall/resources/jobs/requests/GetJobResultsRequest.java
@@ -5,9 +5,9 @@
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;
@@ -36,7 +36,7 @@ private GetJobResultsRequest(
/**
* @return Page number to retrieve.
*/
- @JsonIgnore
+ @JsonProperty("page")
public Optional getPage() {
return page;
}
@@ -44,7 +44,7 @@ public Optional getPage() {
/**
* @return Number of records per page.
*/
- @JsonIgnore
+ @JsonProperty("page_size")
public Optional getPageSize() {
return pageSize;
}
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 81d52bc..f4c7d5d 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
@@ -5,9 +5,9 @@
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;
@@ -47,7 +47,7 @@ private GetUserJobsRequest(
/**
* @return Page number to retrieve.
*/
- @JsonIgnore
+ @JsonProperty("page")
public Optional getPage() {
return page;
}
@@ -55,7 +55,7 @@ public Optional getPage() {
/**
* @return Number of records per page.
*/
- @JsonIgnore
+ @JsonProperty("page_size")
public Optional getPageSize() {
return pageSize;
}
@@ -63,15 +63,12 @@ public Optional getPageSize() {
/**
* @return Filter results by text (case-insensitive substring match).
*/
- @JsonIgnore
+ @JsonProperty("search")
public Optional getSearch() {
return search;
}
- /**
- * @return Filter results by ownership. Defaults to all.
- */
- @JsonIgnore
+ @JsonProperty("ownership")
public Optional getOwnership() {
return ownership;
}
@@ -173,9 +170,6 @@ public Builder search(String search) {
return this;
}
- /**
- * Filter results by ownership. Defaults to all.
- */
@JsonSetter(value = "ownership", nulls = Nulls.SKIP)
public Builder ownership(Optional ownership) {
this.ownership = ownership;
diff --git a/src/main/java/com/newscatcher/catchall/resources/jobs/requests/SubmitRequestDto.java b/src/main/java/com/newscatcher/catchall/resources/jobs/requests/SubmitRequestDto.java
index e7dd3fa..2803a77 100644
--- a/src/main/java/com/newscatcher/catchall/resources/jobs/requests/SubmitRequestDto.java
+++ b/src/main/java/com/newscatcher/catchall/resources/jobs/requests/SubmitRequestDto.java
@@ -44,6 +44,8 @@ public final class SubmitRequestDto {
private final Optional> connectedDatasetIds;
+ private final Optional edScoreMin;
+
private final Map additionalProperties;
private SubmitRequestDto(
@@ -56,6 +58,7 @@ private SubmitRequestDto(
Optional> enrichments,
Optional mode,
Optional> connectedDatasetIds,
+ Optional edScoreMin,
Map additionalProperties) {
this.query = query;
this.context = context;
@@ -66,6 +69,7 @@ private SubmitRequestDto(
this.enrichments = enrichments;
this.mode = mode;
this.connectedDatasetIds = connectedDatasetIds;
+ this.edScoreMin = edScoreMin;
this.additionalProperties = additionalProperties;
}
@@ -125,7 +129,7 @@ public Optional getMode() {
}
/**
- * @return Dataset IDs to connect to this job. When provided, activates Company Watchlist mode — the job returns only events relevant to companies in the connected datasets with each record including a connected_entities array scored per company.
+ * @return Dataset IDs to connect to the job. When provided, this enables Company Watchlist mode — the job returns only events relevant to companies in the connected datasets. To set the minimum relevance threshold, use ed_score_min.
* The dataset must have latest_status: ready before the job is submitted. Submitting with a non-existent or inaccessible dataset ID returns 400.
*/
@JsonProperty("connected_dataset_ids")
@@ -133,6 +137,15 @@ public Optional> getConnectedDatasetIds() {
return connectedDatasetIds;
}
+ /**
+ * @return The minimum relevance score a connected entity must reach for its record to be included in results.
+ * Only valid when connected_dataset_ids is set; otherwise ignored. Records where no connected entity meets the threshold are excluded entirely.
+ */
+ @JsonProperty("ed_score_min")
+ public Optional getEdScoreMin() {
+ return edScoreMin;
+ }
+
@java.lang.Override
public boolean equals(Object other) {
if (this == other) return true;
@@ -153,7 +166,8 @@ private boolean equalTo(SubmitRequestDto other) {
&& validators.equals(other.validators)
&& enrichments.equals(other.enrichments)
&& mode.equals(other.mode)
- && connectedDatasetIds.equals(other.connectedDatasetIds);
+ && connectedDatasetIds.equals(other.connectedDatasetIds)
+ && edScoreMin.equals(other.edScoreMin);
}
@java.lang.Override
@@ -167,7 +181,8 @@ public int hashCode() {
this.validators,
this.enrichments,
this.mode,
- this.connectedDatasetIds);
+ this.connectedDatasetIds,
+ this.edScoreMin);
}
@java.lang.Override
@@ -236,18 +251,28 @@ public interface _FinalStage {
_FinalStage mode(SubmitRequestDtoMode mode);
/**
- * Dataset IDs to connect to this job. When provided, activates Company Watchlist mode — the job returns only events relevant to companies in the connected datasets with each record including a connected_entities array scored per company.
+ * Dataset IDs to connect to the job. When provided, this enables Company Watchlist mode — the job returns only events relevant to companies in the connected datasets. To set the minimum relevance threshold, use ed_score_min.
* The dataset must have latest_status: ready before the job is submitted. Submitting with a non-existent or inaccessible dataset ID returns 400.
*/
_FinalStage connectedDatasetIds(Optional> connectedDatasetIds);
_FinalStage connectedDatasetIds(List connectedDatasetIds);
+
+ /**
+ * The minimum relevance score a connected entity must reach for its record to be included in results.
+ * Only valid when connected_dataset_ids is set; otherwise ignored. Records where no connected entity meets the threshold are excluded entirely.
+ */
+ _FinalStage edScoreMin(Optional edScoreMin);
+
+ _FinalStage edScoreMin(Integer edScoreMin);
}
@JsonIgnoreProperties(ignoreUnknown = true)
public static final class Builder implements QueryStage, _FinalStage {
private String query;
+ private Optional edScoreMin = Optional.empty();
+
private Optional> connectedDatasetIds = Optional.empty();
private Optional mode = Optional.empty();
@@ -280,6 +305,7 @@ public Builder from(SubmitRequestDto other) {
enrichments(other.getEnrichments());
mode(other.getMode());
connectedDatasetIds(other.getConnectedDatasetIds());
+ edScoreMin(other.getEdScoreMin());
return this;
}
@@ -291,7 +317,29 @@ public _FinalStage query(@NotNull String query) {
}
/**
- * Dataset IDs to connect to this job. When provided, activates Company Watchlist mode — the job returns only events relevant to companies in the connected datasets with each record including a connected_entities array scored per company.
+ * The minimum relevance score a connected entity must reach for its record to be included in results.
+ * Only valid when connected_dataset_ids is set; otherwise ignored. Records where no connected entity meets the threshold are excluded entirely.
+ * @return Reference to {@code this} so that method calls can be chained together.
+ */
+ @java.lang.Override
+ public _FinalStage edScoreMin(Integer edScoreMin) {
+ this.edScoreMin = Optional.ofNullable(edScoreMin);
+ return this;
+ }
+
+ /**
+ * The minimum relevance score a connected entity must reach for its record to be included in results.
+ * Only valid when connected_dataset_ids is set; otherwise ignored. Records where no connected entity meets the threshold are excluded entirely.
+ */
+ @java.lang.Override
+ @JsonSetter(value = "ed_score_min", nulls = Nulls.SKIP)
+ public _FinalStage edScoreMin(Optional edScoreMin) {
+ this.edScoreMin = edScoreMin;
+ return this;
+ }
+
+ /**
+ * Dataset IDs to connect to the job. When provided, this enables Company Watchlist mode — the job returns only events relevant to companies in the connected datasets. To set the minimum relevance threshold, use ed_score_min.
* The dataset must have latest_status: ready before the job is submitted. Submitting with a non-existent or inaccessible dataset ID returns 400.
* @return Reference to {@code this} so that method calls can be chained together.
*/
@@ -302,7 +350,7 @@ public _FinalStage connectedDatasetIds(List connectedDatasetIds) {
}
/**
- * Dataset IDs to connect to this job. When provided, activates Company Watchlist mode — the job returns only events relevant to companies in the connected datasets with each record including a connected_entities array scored per company.
+ * Dataset IDs to connect to the job. When provided, this enables Company Watchlist mode — the job returns only events relevant to companies in the connected datasets. To set the minimum relevance threshold, use ed_score_min.
* The dataset must have latest_status: ready before the job is submitted. Submitting with a non-existent or inaccessible dataset ID returns 400.
*/
@java.lang.Override
@@ -448,6 +496,7 @@ public SubmitRequestDto build() {
enrichments,
mode,
connectedDatasetIds,
+ edScoreMin,
additionalProperties);
}
diff --git a/src/main/java/com/newscatcher/catchall/resources/monitors/requests/CreateMonitorRequestDto.java b/src/main/java/com/newscatcher/catchall/resources/monitors/requests/CreateMonitorRequestDto.java
index ee9e30e..35d428c 100644
--- a/src/main/java/com/newscatcher/catchall/resources/monitors/requests/CreateMonitorRequestDto.java
+++ b/src/main/java/com/newscatcher/catchall/resources/monitors/requests/CreateMonitorRequestDto.java
@@ -26,6 +26,8 @@ public final class CreateMonitorRequestDto {
private final String schedule;
+ private final Optional timezone;
+
private final Optional webhook;
private final Optional limit;
@@ -37,12 +39,14 @@ public final class CreateMonitorRequestDto {
private CreateMonitorRequestDto(
String referenceJobId,
String schedule,
+ Optional timezone,
Optional