Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions .fern/metadata.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
{
"cliVersion": "5.38.0",
"cliVersion": "5.45.3",
"generatorName": "fernapi/fern-java-sdk",
"generatorVersion": "4.8.11",
"generatorVersion": "4.9.2",
"generatorConfig": {
"publish-to": "central",
"client-class-name": "CatchAllApi",
"package-prefix": "com.newscatcher.catchall"
},
"originGitCommit": "5c18e5b13a9cc97f8ccdc7b91a6cd7b6f13ad6f4",
"originGitCommit": "56ea60da11c1b8d90274a137f5fbc3bb89b9fac4",
"originGitCommitIsDirty": true,
"invokedBy": "manual",
"requestedVersion": "3.0.0",
"sdkVersion": "3.0.0"
"invokedBy": "ci",
"requestedVersion": "AUTO",
"ciProvider": "unknown",
"sdkVersion": "3.0.1"
}
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Add the dependency in your `build.gradle` file:

```groovy
dependencies {
implementation 'com.newscatcherapi:newscatcher-catchall-sdk:3.0.0'
implementation 'com.newscatcherapi:newscatcher-catchall-sdk:3.0.1'
}
```

Expand All @@ -47,7 +47,7 @@ Add the dependency in your `pom.xml` file:
<dependency>
<groupId>com.newscatcherapi</groupId>
<artifactId>newscatcher-catchall-sdk</artifactId>
<version>3.0.0</version>
<version>3.0.1</version>
</dependency>
```

Expand Down Expand Up @@ -263,3 +263,4 @@ On the other hand, contributions to the README are always very welcome!




4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ java {

group = 'com.newscatcherapi'

version = '3.0.0'
version = '3.0.1'

jar {
dependsOn(":generatePomFileForMavenPublication")
Expand Down Expand Up @@ -78,7 +78,7 @@ publishing {
maven(MavenPublication) {
groupId = 'com.newscatcherapi'
artifactId = 'newscatcher-catchall-sdk'
version = '3.0.0'
version = '3.0.1'
from components.java
pom {
name = 'newscatcher'
Expand Down
43 changes: 43 additions & 0 deletions reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,25 @@ client.jobs().initialize(

**context:** `Optional<String>`

</dd>
</dl>

<dl>
<dd>

**connectedDatasetIds:** `Optional<List<String>>` — Optional list of watchlist dataset IDs connected to this job.

</dd>
</dl>

<dl>
<dd>

**fetchAllWatchlistNews:** `Optional<Boolean>`

When true, returns generic news validators and enrichments suitable for
watchlist-based article collection instead of query-specific fields.

</dd>
</dl>
</dd>
Expand Down Expand Up @@ -383,6 +402,30 @@ Only valid when `connected_dataset_ids` is set; otherwise ignored. Records where

**webhookIds:** `Optional<List<String>>` — IDs of webhooks to notify when the job completes. Maximum 5 per job.

</dd>
</dl>

<dl>
<dd>

**fetchAllWatchlistNews:** `Optional<Boolean>`

When true, retrieves all news for connected Company Watchlist entities
without topic filtering. Requires connected_dataset_ids to be set.

</dd>
</dl>

<dl>
<dd>

**edAssociationType:** `Optional<EntityAssociationType>`

Filter events by entity association type. `event_associated` keeps only
events where the entity is a direct actor. `mention` keeps only events
where the entity is merely referenced. Only relevant when
connected_dataset_ids is set.

</dd>
</dl>
</dd>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ private ClientOptions(
this.headers.putAll(headers);
this.headers.putAll(new HashMap<String, String>() {
{
put("User-Agent", "com.newscatcherapi:newscatcher-catchall-sdk/3.0.0");
put("User-Agent", "com.newscatcherapi:newscatcher-catchall-sdk/3.0.1");
put("X-Fern-Language", "JAVA");
put("X-Fern-SDK-Name", "com.newscatcher.fern:api-sdk");
put("X-Fern-SDK-Version", "3.0.0");
put("X-Fern-SDK-Version", "3.0.1");
}
});
this.headerSuppliers = headerSuppliers;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ public CompletableFuture<CatchAllApiHttpResponse<CreateDatasetCsvResponse>> crea
Request.Builder _requestBuilder = new Request.Builder();
_requestBuilder.url(httpUrl.build());
_requestBuilder.method("POST", body);
_requestBuilder.headers(Headers.of(this.clientOptions.headers(null)));
_requestBuilder.headers(Headers.of(this.clientOptions.headers((RequestOptions) null)));
Request okhttpRequest = _requestBuilder.build();
OkHttpClient client = clientOptions.httpClient();
CompletableFuture<CatchAllApiHttpResponse<CreateDatasetCsvResponse>> future = new CompletableFuture<>();
Expand Down Expand Up @@ -453,7 +453,7 @@ public CompletableFuture<CatchAllApiHttpResponse<CreateDatasetCsvResponse>> crea
Request.Builder _requestBuilder = new Request.Builder();
_requestBuilder.url(httpUrl.build());
_requestBuilder.method("POST", body);
_requestBuilder.headers(Headers.of(this.clientOptions.headers(null)));
_requestBuilder.headers(Headers.of(this.clientOptions.headers((RequestOptions) null)));
Request okhttpRequest = _requestBuilder.build();
OkHttpClient client = clientOptions.httpClient();
CompletableFuture<CatchAllApiHttpResponse<CreateDatasetCsvResponse>> future = new CompletableFuture<>();
Expand Down Expand Up @@ -1439,7 +1439,7 @@ public CompletableFuture<CatchAllApiHttpResponse<UploadCsvToDatasetResponse>> up
Request.Builder _requestBuilder = new Request.Builder();
_requestBuilder.url(httpUrl.build());
_requestBuilder.method("POST", body);
_requestBuilder.headers(Headers.of(this.clientOptions.headers(null)));
_requestBuilder.headers(Headers.of(this.clientOptions.headers((RequestOptions) null)));
Request okhttpRequest = _requestBuilder.build();
OkHttpClient client = clientOptions.httpClient();
CompletableFuture<CatchAllApiHttpResponse<UploadCsvToDatasetResponse>> future = new CompletableFuture<>();
Expand Down Expand Up @@ -1508,7 +1508,7 @@ public CompletableFuture<CatchAllApiHttpResponse<UploadCsvToDatasetResponse>> up
Request.Builder _requestBuilder = new Request.Builder();
_requestBuilder.url(httpUrl.build());
_requestBuilder.method("POST", body);
_requestBuilder.headers(Headers.of(this.clientOptions.headers(null)));
_requestBuilder.headers(Headers.of(this.clientOptions.headers((RequestOptions) null)));
Request okhttpRequest = _requestBuilder.build();
OkHttpClient client = clientOptions.httpClient();
CompletableFuture<CatchAllApiHttpResponse<UploadCsvToDatasetResponse>> future = new CompletableFuture<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ public CatchAllApiHttpResponse<CreateDatasetCsvResponse> createDatasetFromCsv(In
Request.Builder _requestBuilder = new Request.Builder();
_requestBuilder.url(httpUrl.build());
_requestBuilder.method("POST", body);
_requestBuilder.headers(Headers.of(this.clientOptions.headers(null)));
_requestBuilder.headers(Headers.of(this.clientOptions.headers((RequestOptions) null)));
Request okhttpRequest = _requestBuilder.build();
OkHttpClient client = clientOptions.httpClient();
try (Response response = client.newCall(okhttpRequest).execute()) {
Expand Down Expand Up @@ -379,7 +379,7 @@ public CatchAllApiHttpResponse<CreateDatasetCsvResponse> createDatasetFromCsv(
Request.Builder _requestBuilder = new Request.Builder();
_requestBuilder.url(httpUrl.build());
_requestBuilder.method("POST", body);
_requestBuilder.headers(Headers.of(this.clientOptions.headers(null)));
_requestBuilder.headers(Headers.of(this.clientOptions.headers((RequestOptions) null)));
Request okhttpRequest = _requestBuilder.build();
OkHttpClient client = clientOptions.httpClient();
try (Response response = client.newCall(okhttpRequest).execute()) {
Expand Down Expand Up @@ -1155,7 +1155,7 @@ public CatchAllApiHttpResponse<UploadCsvToDatasetResponse> uploadCsvToDataset(
Request.Builder _requestBuilder = new Request.Builder();
_requestBuilder.url(httpUrl.build());
_requestBuilder.method("POST", body);
_requestBuilder.headers(Headers.of(this.clientOptions.headers(null)));
_requestBuilder.headers(Headers.of(this.clientOptions.headers((RequestOptions) null)));
Request okhttpRequest = _requestBuilder.build();
OkHttpClient client = clientOptions.httpClient();
try (Response response = client.newCall(okhttpRequest).execute()) {
Expand Down Expand Up @@ -1204,7 +1204,7 @@ public CatchAllApiHttpResponse<UploadCsvToDatasetResponse> uploadCsvToDataset(
Request.Builder _requestBuilder = new Request.Builder();
_requestBuilder.url(httpUrl.build());
_requestBuilder.method("POST", body);
_requestBuilder.headers(Headers.of(this.clientOptions.headers(null)));
_requestBuilder.headers(Headers.of(this.clientOptions.headers((RequestOptions) null)));
Request okhttpRequest = _requestBuilder.build();
OkHttpClient client = clientOptions.httpClient();
try (Response response = client.newCall(okhttpRequest).execute()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.newscatcher.catchall.core.ObjectMappers;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
Expand All @@ -25,11 +26,22 @@ public final class InitializeRequestDto {

private final Optional<String> context;

private final Optional<List<String>> connectedDatasetIds;

private final Optional<Boolean> fetchAllWatchlistNews;

private final Map<String, Object> additionalProperties;

private InitializeRequestDto(String query, Optional<String> context, Map<String, Object> additionalProperties) {
private InitializeRequestDto(
String query,
Optional<String> context,
Optional<List<String>> connectedDatasetIds,
Optional<Boolean> fetchAllWatchlistNews,
Map<String, Object> additionalProperties) {
this.query = query;
this.context = context;
this.connectedDatasetIds = connectedDatasetIds;
this.fetchAllWatchlistNews = fetchAllWatchlistNews;
this.additionalProperties = additionalProperties;
}

Expand All @@ -43,6 +55,23 @@ public Optional<String> getContext() {
return context;
}

/**
* @return Optional list of watchlist dataset IDs connected to this job.
*/
@JsonProperty("connected_dataset_ids")
public Optional<List<String>> getConnectedDatasetIds() {
return connectedDatasetIds;
}

/**
* @return When true, returns generic news validators and enrichments suitable for
* watchlist-based article collection instead of query-specific fields.
*/
@JsonProperty("fetch_all_watchlist_news")
public Optional<Boolean> getFetchAllWatchlistNews() {
return fetchAllWatchlistNews;
}

@java.lang.Override
public boolean equals(Object other) {
if (this == other) return true;
Expand All @@ -55,12 +84,15 @@ public Map<String, Object> getAdditionalProperties() {
}

private boolean equalTo(InitializeRequestDto other) {
return query.equals(other.query) && context.equals(other.context);
return query.equals(other.query)
&& context.equals(other.context)
&& connectedDatasetIds.equals(other.connectedDatasetIds)
&& fetchAllWatchlistNews.equals(other.fetchAllWatchlistNews);
}

@java.lang.Override
public int hashCode() {
return Objects.hash(this.query, this.context);
return Objects.hash(this.query, this.context, this.connectedDatasetIds, this.fetchAllWatchlistNews);
}

@java.lang.Override
Expand Down Expand Up @@ -88,12 +120,31 @@ public interface _FinalStage {
_FinalStage context(Optional<String> context);

_FinalStage context(String context);

/**
* <p>Optional list of watchlist dataset IDs connected to this job.</p>
*/
_FinalStage connectedDatasetIds(Optional<List<String>> connectedDatasetIds);

_FinalStage connectedDatasetIds(List<String> connectedDatasetIds);

/**
* <p>When true, returns generic news validators and enrichments suitable for
* watchlist-based article collection instead of query-specific fields.</p>
*/
_FinalStage fetchAllWatchlistNews(Optional<Boolean> fetchAllWatchlistNews);

_FinalStage fetchAllWatchlistNews(Boolean fetchAllWatchlistNews);
}

@JsonIgnoreProperties(ignoreUnknown = true)
public static final class Builder implements QueryStage, _FinalStage {
private String query;

private Optional<Boolean> fetchAllWatchlistNews = Optional.empty();

private Optional<List<String>> connectedDatasetIds = Optional.empty();

private Optional<String> context = Optional.empty();

@JsonAnySetter
Expand All @@ -105,6 +156,8 @@ private Builder() {}
public Builder from(InitializeRequestDto other) {
query(other.getQuery());
context(other.getContext());
connectedDatasetIds(other.getConnectedDatasetIds());
fetchAllWatchlistNews(other.getFetchAllWatchlistNews());
return this;
}

Expand All @@ -115,6 +168,48 @@ public _FinalStage query(@NotNull String query) {
return this;
}

/**
* <p>When true, returns generic news validators and enrichments suitable for
* watchlist-based article collection instead of query-specific fields.</p>
* @return Reference to {@code this} so that method calls can be chained together.
*/
@java.lang.Override
public _FinalStage fetchAllWatchlistNews(Boolean fetchAllWatchlistNews) {
this.fetchAllWatchlistNews = Optional.ofNullable(fetchAllWatchlistNews);
return this;
}

/**
* <p>When true, returns generic news validators and enrichments suitable for
* watchlist-based article collection instead of query-specific fields.</p>
*/
@java.lang.Override
@JsonSetter(value = "fetch_all_watchlist_news", nulls = Nulls.SKIP)
public _FinalStage fetchAllWatchlistNews(Optional<Boolean> fetchAllWatchlistNews) {
this.fetchAllWatchlistNews = fetchAllWatchlistNews;
return this;
}

/**
* <p>Optional list of watchlist dataset IDs connected to this job.</p>
* @return Reference to {@code this} so that method calls can be chained together.
*/
@java.lang.Override
public _FinalStage connectedDatasetIds(List<String> connectedDatasetIds) {
this.connectedDatasetIds = Optional.ofNullable(connectedDatasetIds);
return this;
}

/**
* <p>Optional list of watchlist dataset IDs connected to this job.</p>
*/
@java.lang.Override
@JsonSetter(value = "connected_dataset_ids", nulls = Nulls.SKIP)
public _FinalStage connectedDatasetIds(Optional<List<String>> connectedDatasetIds) {
this.connectedDatasetIds = connectedDatasetIds;
return this;
}

@java.lang.Override
public _FinalStage context(String context) {
this.context = Optional.ofNullable(context);
Expand All @@ -130,7 +225,8 @@ public _FinalStage context(Optional<String> context) {

@java.lang.Override
public InitializeRequestDto build() {
return new InitializeRequestDto(query, context, additionalProperties);
return new InitializeRequestDto(
query, context, connectedDatasetIds, fetchAllWatchlistNews, additionalProperties);
}

@java.lang.Override
Expand Down
Loading
Loading