From a2dc4f664ac1b96d67c9e34d1b71fbdb1be80cb2 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Thu, 23 Apr 2026 13:58:25 +0000 Subject: [PATCH] feat: add qwen_embedding field and fix request object serialization MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add the `qwenEmbedding` field to `NlpDataEntity` for articles indexed from January 1, 2026 onward using the Qwen3-Embedding-0.6B model. Fix request objects (`GetAggregationCountRequest`, `GetAuthorsRequest`) to use `@JsonIgnore` instead of `@JsonProperty` on getter methods, preventing fields from being serialized into the JSON request body (these are query-parameter-only request objects). Also reorder static constants in `NewsDomainType` and `SortBy` enums, and refactor `RetryInterceptor` to create a fresh `ExponentialBackoff` per retry cycle. Key changes: - Add `qwenEmbedding` (`Optional>`) field and builder methods to `NlpDataEntity` - Replace `@JsonProperty` with `@JsonIgnore` on all getter methods in `GetAggregationCountRequest` and `GetAuthorsRequest` to prevent incorrect JSON serialization - Reorder static constants and switch cases in `NewsDomainType` and `SortBy` enums (no semantic change) - Refactor `RetryInterceptor` to instantiate `ExponentialBackoff` per retry invocation rather than sharing a stateful instance 🌿 Generated with Fern --- .fern/metadata.json | 12 +- .fernignore | 1 + README.md | 7 +- build.gradle | 4 +- changelog.md | 10 ++ reference.md | 20 +-- .../newscatcher/api/core/ClientOptions.java | 4 +- .../api/core/DoubleSerializer.java | 43 +++++++ .../newscatcher/api/core/ObjectMappers.java | 1 + .../api/core/RetryInterceptor.java | 9 +- .../requests/GetAggregationCountRequest.java | 92 +++++++------- .../authors/requests/GetAuthorsRequest.java | 90 +++++++------- .../requests/GetBreakingNewsRequest.java | 42 +++---- .../requests/GetLatestHeadlinesRequest.java | 92 +++++++------- .../search/requests/GetSearchRequest.java | 116 +++++++++--------- .../requests/GetSearchByLinkRequest.java | 16 +-- .../sources/requests/GetSourcesRequest.java | 24 ++-- .../newscatcher/api/types/NewsDomainType.java | 24 ++-- .../newscatcher/api/types/NlpDataEntity.java | 38 +++++- .../com/newscatcher/api/types/SortBy.java | 12 +- 20 files changed, 376 insertions(+), 281 deletions(-) create mode 100644 changelog.md create mode 100644 src/main/java/com/newscatcher/api/core/DoubleSerializer.java diff --git a/.fern/metadata.json b/.fern/metadata.json index dfe97e3..96f3c55 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -1,10 +1,14 @@ { - "cliVersion": "4.29.0", + "cliVersion": "4.90.0", "generatorName": "fernapi/fern-java-sdk", - "generatorVersion": "3.44.1", + "generatorVersion": "4.4.1", "generatorConfig": { "publish-to": "central" }, - "originGitCommit": "bbd2054c67ad246b017399f96faf58cf6737bf01", - "sdkVersion": "2.0.0" + "originGitCommit": "3707beee5d0e236f2469e89f7b19c3a08efb6f95", + "originGitCommitIsDirty": true, + "invokedBy": "ci", + "requestedVersion": "AUTO", + "ciProvider": "unknown", + "sdkVersion": "2.1.0" } \ No newline at end of file diff --git a/.fernignore b/.fernignore index 7896a51..3a2ac6b 100644 --- a/.fernignore +++ b/.fernignore @@ -1,3 +1,4 @@ LICENSE # README.md +changelog.md diff --git a/README.md b/README.md index 1ac614f..4b42499 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ Add the dependency in your `build.gradle` file: ```groovy dependencies { - implementation 'com.newscatcherapi:newscatcher-sdk' + implementation 'com.newscatcherapi:newscatcher-sdk:2.1.0' } ``` @@ -55,7 +55,7 @@ Add the dependency in your `pom.xml` file: com.newscatcherapi newscatcher-sdk - 2.0.0 + 2.1.0 ``` @@ -334,7 +334,7 @@ The `withRawResponse()` method returns a raw client that wraps all responses wit (A normal client's `response` is identical to a raw client's `response.body()`.) ```java -PostHttpResponse response = client.search().withRawResponse().post(...); +NewscatcherApiHttpResponse response = client.search().withRawResponse().post(...); System.out.println(response.body()); System.out.println(response.headers().get("X-My-Header")); @@ -353,3 +353,4 @@ On the other hand, contributions to the README are always very welcome! For release notes and changelog, visit our [GitHub releases page](https://github.com/Newscatcher/newscatcher-java/releases). + diff --git a/build.gradle b/build.gradle index 19a4cb8..dda67db 100644 --- a/build.gradle +++ b/build.gradle @@ -47,7 +47,7 @@ java { group = 'com.newscatcherapi' -version = '2.0.0' +version = '2.1.0' jar { dependsOn(":generatePomFileForMavenPublication") @@ -78,7 +78,7 @@ publishing { maven(MavenPublication) { groupId = 'com.newscatcherapi' artifactId = 'newscatcher-sdk' - version = '2.0.0' + version = '2.1.0' from components.java pom { name = 'newscatcher' diff --git a/changelog.md b/changelog.md new file mode 100644 index 0000000..6006270 --- /dev/null +++ b/changelog.md @@ -0,0 +1,10 @@ +## 2.1.0 - 2026-04-23 +* ## [2.1.0] - 2025-07-10 +### Added +* **`NlpDataEntity.getQwenEmbedding()`** — new `Optional>` field exposing a 1024-dimensional Qwen3-Embedding-0.6B vector for articles indexed from January 1, 2026 onward (requires the `v3_nlp_embeddings` plan). +### Changed +* **`ObjectMappers`** — now registers a custom `DoubleSerializer` that writes integer-valued doubles (e.g. `24000.0`) as plain integers (`24000`) in all serialized output. +### Fixed +* **`GetAggregationCountRequest`**, **`GetAuthorsRequest`**, and **`GetSourcesRequest`** — getter methods are now annotated with `@JsonIgnore` instead of `@JsonProperty`, preventing query-parameter-only fields from being incorrectly serialized into the JSON request body. +* **`RetryInterceptor`** — `ExponentialBackoff` is now instantiated fresh per retry cycle, eliminating shared mutable state across concurrent requests. + diff --git a/reference.md b/reference.md index 80466b9..458dcb2 100644 --- a/reference.md +++ b/reference.md @@ -43,10 +43,10 @@ client.search().get( .notCountries("UK,FR") .notAuthorName("John Doe, Jane Doe") .from( - From.of(OffsetDateTime.parse("2024-07-01T00:00:00Z")) + From.of(OffsetDateTime.parse("1 day ago")) ) .to( - To.of(OffsetDateTime.parse("2024-01-01T00:00:00Z")) + To.of(OffsetDateTime.parse("1 day ago")) ) .publishedDatePrecision("full") .byParseDate(true) @@ -68,7 +68,7 @@ client.search().get( .page(2) .pageSize(50) .clusteringEnabled(true) - .clusteringThreshold(0.6f) + .clusteringThreshold(0.7f) .includeNlpData(true) .hasNlp(true) .theme("Finance,Tech") @@ -1202,7 +1202,7 @@ client.latestHeadlines().get( .page(2) .pageSize(50) .clusteringEnabled(true) - .clusteringThreshold(0.6f) + .clusteringThreshold(0.7f) .includeTranslationFields(true) .includeNlpData(true) .hasNlp(true) @@ -2558,10 +2558,10 @@ client.authors().get( .countries("US,CA") .notCountries("UK,FR") .from( - From.of(OffsetDateTime.parse("2024-07-01T00:00:00Z")) + From.of(OffsetDateTime.parse("1 day ago")) ) .to( - To.of(OffsetDateTime.parse("2024-01-01T00:00:00Z")) + To.of(OffsetDateTime.parse("1 day ago")) ) .publishedDatePrecision("full") .byParseDate(true) @@ -3472,10 +3472,10 @@ client.searchByLink().get( .ids("5f8d0d55b6e45e00179c6e7e") .links("https://nytimes.com/article1,https://bbc.com/article2") .from( - From.of(OffsetDateTime.parse("2024-07-01T00:00:00Z")) + From.of(OffsetDateTime.parse("1 day ago")) ) .to( - To.of(OffsetDateTime.parse("2024-01-01T00:00:00Z")) + To.of(OffsetDateTime.parse("1 day ago")) ) .page(2) .pageSize(50) @@ -4050,10 +4050,10 @@ client.aggregationCount().get( .notCountries("UK,FR") .notAuthorName("John Doe, Jane Doe") .from( - From.of(OffsetDateTime.parse("2024-07-01T00:00:00Z")) + From.of(OffsetDateTime.parse("1 day ago")) ) .to( - To.of(OffsetDateTime.parse("2024-01-01T00:00:00Z")) + To.of(OffsetDateTime.parse("1 day ago")) ) .publishedDatePrecision("full") .byParseDate(true) diff --git a/src/main/java/com/newscatcher/api/core/ClientOptions.java b/src/main/java/com/newscatcher/api/core/ClientOptions.java index 8b1bf29..0651c5c 100644 --- a/src/main/java/com/newscatcher/api/core/ClientOptions.java +++ b/src/main/java/com/newscatcher/api/core/ClientOptions.java @@ -38,10 +38,10 @@ private ClientOptions( this.headers.putAll(headers); this.headers.putAll(new HashMap() { { - put("User-Agent", "com.newscatcherapi:newscatcher-sdk/2.0.0"); + put("User-Agent", "com.newscatcherapi:newscatcher-sdk/2.1.0"); put("X-Fern-Language", "JAVA"); put("X-Fern-SDK-Name", "com.newscatcher.fern:api-sdk"); - put("X-Fern-SDK-Version", "2.0.0"); + put("X-Fern-SDK-Version", "2.1.0"); } }); this.headerSuppliers = headerSuppliers; diff --git a/src/main/java/com/newscatcher/api/core/DoubleSerializer.java b/src/main/java/com/newscatcher/api/core/DoubleSerializer.java new file mode 100644 index 0000000..e3cb0e9 --- /dev/null +++ b/src/main/java/com/newscatcher/api/core/DoubleSerializer.java @@ -0,0 +1,43 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.newscatcher.api.core; + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.databind.JsonSerializer; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.module.SimpleModule; +import java.io.IOException; + +/** + * Custom serializer that writes integer-valued doubles without a decimal point. + * For example, {@code 24000.0} is serialized as {@code 24000} instead of {@code 24000.0}. + * Non-integer values like {@code 3.14} are serialized normally. + */ +class DoubleSerializer extends JsonSerializer { + private static final SimpleModule MODULE; + + static { + MODULE = new SimpleModule() + .addSerializer(Double.class, new DoubleSerializer()) + .addSerializer(double.class, new DoubleSerializer()); + } + + /** + * Gets a module wrapping this serializer as an adapter for the Jackson ObjectMapper. + * + * @return A {@link SimpleModule} to be plugged onto Jackson ObjectMapper. + */ + public static SimpleModule getModule() { + return MODULE; + } + + @Override + public void serialize(Double value, JsonGenerator gen, SerializerProvider serializers) throws IOException { + if (value != null && value == Math.floor(value) && !Double.isInfinite(value) && !Double.isNaN(value)) { + gen.writeNumber(value.longValue()); + } else { + gen.writeNumber(value); + } + } +} diff --git a/src/main/java/com/newscatcher/api/core/ObjectMappers.java b/src/main/java/com/newscatcher/api/core/ObjectMappers.java index 8e78be8..315f90b 100644 --- a/src/main/java/com/newscatcher/api/core/ObjectMappers.java +++ b/src/main/java/com/newscatcher/api/core/ObjectMappers.java @@ -18,6 +18,7 @@ public final class ObjectMappers { .addModule(new Jdk8Module()) .addModule(new JavaTimeModule()) .addModule(DateTimeDeserializer.getModule()) + .addModule(DoubleSerializer.getModule()) .disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES) .disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS) .build(); diff --git a/src/main/java/com/newscatcher/api/core/RetryInterceptor.java b/src/main/java/com/newscatcher/api/core/RetryInterceptor.java index 265fe1f..6a782b7 100644 --- a/src/main/java/com/newscatcher/api/core/RetryInterceptor.java +++ b/src/main/java/com/newscatcher/api/core/RetryInterceptor.java @@ -19,11 +19,11 @@ public class RetryInterceptor implements Interceptor { private static final Duration MAX_RETRY_DELAY = Duration.ofMillis(60000); private static final double JITTER_FACTOR = 0.2; - private final ExponentialBackoff backoff; + private final int maxRetries; private final Random random = new Random(); public RetryInterceptor(int maxRetries) { - this.backoff = new ExponentialBackoff(maxRetries); + this.maxRetries = maxRetries; } @Override @@ -38,7 +38,8 @@ public Response intercept(Chain chain) throws IOException { } private Response retryChain(Response response, Chain chain) throws IOException { - Optional nextBackoff = this.backoff.nextBackoff(response); + ExponentialBackoff backoff = new ExponentialBackoff(this.maxRetries); + Optional nextBackoff = backoff.nextBackoff(response); while (nextBackoff.isPresent()) { try { Thread.sleep(nextBackoff.get().toMillis()); @@ -48,7 +49,7 @@ private Response retryChain(Response response, Chain chain) throws IOException { response.close(); response = chain.proceed(chain.request()); if (shouldRetry(response.code())) { - nextBackoff = this.backoff.nextBackoff(response); + nextBackoff = backoff.nextBackoff(response); } else { return response; } diff --git a/src/main/java/com/newscatcher/api/resources/aggregationcount/requests/GetAggregationCountRequest.java b/src/main/java/com/newscatcher/api/resources/aggregationcount/requests/GetAggregationCountRequest.java index 8b003f3..be02cf9 100644 --- a/src/main/java/com/newscatcher/api/resources/aggregationcount/requests/GetAggregationCountRequest.java +++ b/src/main/java/com/newscatcher/api/resources/aggregationcount/requests/GetAggregationCountRequest.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; @@ -212,17 +212,17 @@ private GetAggregationCountRequest( this.additionalProperties = additionalProperties; } - @JsonProperty("q") + @JsonIgnore public String getQ() { return q; } - @JsonProperty("aggregation_by") + @JsonIgnore public Optional getAggregationBy() { return aggregationBy; } - @JsonProperty("search_in") + @JsonIgnore public Optional getSearchIn() { return searchIn; } @@ -232,7 +232,7 @@ public Optional getSearchIn() { *

Format: start with the word top, followed by the number of desired sources, and then the two-letter country code ISO 3166-1 alpha-2.

*

Multiple countries with the number of top sources can be specified as a comma-separated string.

*/ - @JsonProperty("predefined_sources") + @JsonIgnore public Optional getPredefinedSources() { return predefinedSources; } @@ -240,7 +240,7 @@ public Optional getPredefinedSources() { /** * @return One or more news sources to narrow down the search. The format must be a domain URL. Subdomains, such as finance.yahoo.com, are also acceptable.To specify multiple sources, use a comma-separated string. */ - @JsonProperty("sources") + @JsonIgnore public Optional getSources() { return sources; } @@ -248,7 +248,7 @@ public Optional getSources() { /** * @return The news sources to exclude from the search. To exclude multiple sources, use a comma-separated string. */ - @JsonProperty("not_sources") + @JsonIgnore public Optional getNotSources() { return notSources; } @@ -257,7 +257,7 @@ public Optional getNotSources() { * @return The language(s) of the search. The only accepted format is the two-letter ISO 639-1 code. To select multiple languages, use a comma-separated string. *

To learn more, see Enumerated parameters > Language.

*/ - @JsonProperty("lang") + @JsonIgnore public Optional getLang() { return lang; } @@ -266,7 +266,7 @@ public Optional getLang() { * @return The language(s) to exclude from the search. The accepted format is the two-letter ISO 639-1 code. To exclude multiple languages, use a comma-separated string. *

To learn more, see Enumerated parameters > Language.

*/ - @JsonProperty("not_lang") + @JsonIgnore public Optional getNotLang() { return notLang; } @@ -275,7 +275,7 @@ public Optional getNotLang() { * @return The countries where the news publisher is located. The accepted format is the two-letter ISO 3166-1 alpha-2 code. To select multiple countries, use a comma-separated string. *

To learn more, see Enumerated parameters > Country.

*/ - @JsonProperty("countries") + @JsonIgnore public Optional getCountries() { return countries; } @@ -284,7 +284,7 @@ public Optional getCountries() { * @return The publisher location countries to exclude from the search. The accepted format is the two-letter ISO 3166-1 alpha-2 code. To exclude multiple countries, use a comma-separated string. *

To learn more, see Enumerated parameters > Country.

*/ - @JsonProperty("not_countries") + @JsonIgnore public Optional getNotCountries() { return notCountries; } @@ -292,62 +292,62 @@ public Optional getNotCountries() { /** * @return The list of author names to exclude from your search. To exclude articles by specific authors, use a comma-separated string. */ - @JsonProperty("not_author_name") + @JsonIgnore public Optional getNotAuthorName() { return notAuthorName; } - @JsonProperty("from_") + @JsonIgnore public Optional getFrom() { return from; } - @JsonProperty("to_") + @JsonIgnore public Optional getTo() { return to; } - @JsonProperty("published_date_precision") + @JsonIgnore public Optional getPublishedDatePrecision() { return publishedDatePrecision; } - @JsonProperty("by_parse_date") + @JsonIgnore public Optional getByParseDate() { return byParseDate; } - @JsonProperty("sort_by") + @JsonIgnore public Optional getSortBy() { return sortBy; } - @JsonProperty("ranked_only") + @JsonIgnore public Optional getRankedOnly() { return rankedOnly; } - @JsonProperty("from_rank") + @JsonIgnore public Optional getFromRank() { return fromRank; } - @JsonProperty("to_rank") + @JsonIgnore public Optional getToRank() { return toRank; } - @JsonProperty("is_headline") + @JsonIgnore public Optional getIsHeadline() { return isHeadline; } - @JsonProperty("is_opinion") + @JsonIgnore public Optional getIsOpinion() { return isOpinion; } - @JsonProperty("is_paid_content") + @JsonIgnore public Optional getIsPaidContent() { return isPaidContent; } @@ -355,7 +355,7 @@ public Optional getIsPaidContent() { /** * @return The categorical URL(s) to filter your search. To filter your search by multiple categorical URLs, use a comma-separated string. */ - @JsonProperty("parent_url") + @JsonIgnore public Optional getParentUrl() { return parentUrl; } @@ -364,7 +364,7 @@ public Optional getParentUrl() { * @return The complete URL(s) mentioned in the article. For multiple URLs, use a comma-separated string. *

For more details, see Search by URL.

*/ - @JsonProperty("all_links") + @JsonIgnore public Optional getAllLinks() { return allLinks; } @@ -373,7 +373,7 @@ public Optional getAllLinks() { * @return The domain(s) mentioned in the article. For multiple domains, use a comma-separated string. *

For more details, see Search by URL.

*/ - @JsonProperty("all_domain_links") + @JsonIgnore public Optional getAllDomainLinks() { return allDomainLinks; } @@ -383,87 +383,87 @@ public Optional getAllDomainLinks() { *

Note: When this parameter is used, the response includes the all_links_data field with detailed link information.

*

To learn more, see Search by URL.

*/ - @JsonProperty("all_links_text") + @JsonIgnore public Optional getAllLinksText() { return allLinksText; } - @JsonProperty("word_count_min") + @JsonIgnore public Optional getWordCountMin() { return wordCountMin; } - @JsonProperty("word_count_max") + @JsonIgnore public Optional getWordCountMax() { return wordCountMax; } - @JsonProperty("page") + @JsonIgnore public Optional getPage() { return page; } - @JsonProperty("page_size") + @JsonIgnore public Optional getPageSize() { return pageSize; } - @JsonProperty("include_nlp_data") + @JsonIgnore public Optional getIncludeNlpData() { return includeNlpData; } - @JsonProperty("has_nlp") + @JsonIgnore public Optional getHasNlp() { return hasNlp; } - @JsonProperty("theme") + @JsonIgnore public Optional getTheme() { return theme; } - @JsonProperty("not_theme") + @JsonIgnore public Optional getNotTheme() { return notTheme; } - @JsonProperty("ORG_entity_name") + @JsonIgnore public Optional getOrgEntityName() { return orgEntityName; } - @JsonProperty("PER_entity_name") + @JsonIgnore public Optional getPerEntityName() { return perEntityName; } - @JsonProperty("LOC_entity_name") + @JsonIgnore public Optional getLocEntityName() { return locEntityName; } - @JsonProperty("MISC_entity_name") + @JsonIgnore public Optional getMiscEntityName() { return miscEntityName; } - @JsonProperty("title_sentiment_min") + @JsonIgnore public Optional getTitleSentimentMin() { return titleSentimentMin; } - @JsonProperty("title_sentiment_max") + @JsonIgnore public Optional getTitleSentimentMax() { return titleSentimentMax; } - @JsonProperty("content_sentiment_min") + @JsonIgnore public Optional getContentSentimentMin() { return contentSentimentMin; } - @JsonProperty("content_sentiment_max") + @JsonIgnore public Optional getContentSentimentMax() { return contentSentimentMax; } @@ -473,7 +473,7 @@ public Optional getContentSentimentMax() { *

Note: The iptc_tags parameter is only available in the v3_nlp_iptc_tags subscription plan.

*

To learn more, see IPTC Media Topic NewsCodes.

*/ - @JsonProperty("iptc_tags") + @JsonIgnore public Optional getIptcTags() { return iptcTags; } @@ -483,12 +483,12 @@ public Optional getIptcTags() { *

Note: The not_iptc_tags parameter is only available in the v3_nlp_iptc_tags subscription plan.

*

To learn more, see IPTC Media Topic NewsCodes.

*/ - @JsonProperty("not_iptc_tags") + @JsonIgnore public Optional getNotIptcTags() { return notIptcTags; } - @JsonProperty("robots_compliant") + @JsonIgnore public Optional getRobotsCompliant() { return robotsCompliant; } diff --git a/src/main/java/com/newscatcher/api/resources/authors/requests/GetAuthorsRequest.java b/src/main/java/com/newscatcher/api/resources/authors/requests/GetAuthorsRequest.java index f89605f..b68f3c9 100644 --- a/src/main/java/com/newscatcher/api/resources/authors/requests/GetAuthorsRequest.java +++ b/src/main/java/com/newscatcher/api/resources/authors/requests/GetAuthorsRequest.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; @@ -207,7 +207,7 @@ private GetAuthorsRequest( this.additionalProperties = additionalProperties; } - @JsonProperty("author_name") + @JsonIgnore public String getAuthorName() { return authorName; } @@ -215,7 +215,7 @@ public String getAuthorName() { /** * @return The list of author names to exclude from your search. To exclude articles by specific authors, use a comma-separated string. */ - @JsonProperty("not_author_name") + @JsonIgnore public Optional getNotAuthorName() { return notAuthorName; } @@ -225,7 +225,7 @@ public Optional getNotAuthorName() { *

Format: start with the word top, followed by the number of desired sources, and then the two-letter country code ISO 3166-1 alpha-2.

*

Multiple countries with the number of top sources can be specified as a comma-separated string.

*/ - @JsonProperty("predefined_sources") + @JsonIgnore public Optional getPredefinedSources() { return predefinedSources; } @@ -233,7 +233,7 @@ public Optional getPredefinedSources() { /** * @return One or more news sources to narrow down the search. The format must be a domain URL. Subdomains, such as finance.yahoo.com, are also acceptable.To specify multiple sources, use a comma-separated string. */ - @JsonProperty("sources") + @JsonIgnore public Optional getSources() { return sources; } @@ -241,7 +241,7 @@ public Optional getSources() { /** * @return The news sources to exclude from the search. To exclude multiple sources, use a comma-separated string. */ - @JsonProperty("not_sources") + @JsonIgnore public Optional getNotSources() { return notSources; } @@ -250,7 +250,7 @@ public Optional getNotSources() { * @return The language(s) of the search. The only accepted format is the two-letter ISO 639-1 code. To select multiple languages, use a comma-separated string. *

To learn more, see Enumerated parameters > Language.

*/ - @JsonProperty("lang") + @JsonIgnore public Optional getLang() { return lang; } @@ -259,7 +259,7 @@ public Optional getLang() { * @return The language(s) to exclude from the search. The accepted format is the two-letter ISO 639-1 code. To exclude multiple languages, use a comma-separated string. *

To learn more, see Enumerated parameters > Language.

*/ - @JsonProperty("not_lang") + @JsonIgnore public Optional getNotLang() { return notLang; } @@ -268,7 +268,7 @@ public Optional getNotLang() { * @return The countries where the news publisher is located. The accepted format is the two-letter ISO 3166-1 alpha-2 code. To select multiple countries, use a comma-separated string. *

To learn more, see Enumerated parameters > Country.

*/ - @JsonProperty("countries") + @JsonIgnore public Optional getCountries() { return countries; } @@ -277,62 +277,62 @@ public Optional getCountries() { * @return The publisher location countries to exclude from the search. The accepted format is the two-letter ISO 3166-1 alpha-2 code. To exclude multiple countries, use a comma-separated string. *

To learn more, see Enumerated parameters > Country.

*/ - @JsonProperty("not_countries") + @JsonIgnore public Optional getNotCountries() { return notCountries; } - @JsonProperty("from_") + @JsonIgnore public Optional getFrom() { return from; } - @JsonProperty("to_") + @JsonIgnore public Optional getTo() { return to; } - @JsonProperty("published_date_precision") + @JsonIgnore public Optional getPublishedDatePrecision() { return publishedDatePrecision; } - @JsonProperty("by_parse_date") + @JsonIgnore public Optional getByParseDate() { return byParseDate; } - @JsonProperty("sort_by") + @JsonIgnore public Optional getSortBy() { return sortBy; } - @JsonProperty("ranked_only") + @JsonIgnore public Optional getRankedOnly() { return rankedOnly; } - @JsonProperty("from_rank") + @JsonIgnore public Optional getFromRank() { return fromRank; } - @JsonProperty("to_rank") + @JsonIgnore public Optional getToRank() { return toRank; } - @JsonProperty("is_headline") + @JsonIgnore public Optional getIsHeadline() { return isHeadline; } - @JsonProperty("is_opinion") + @JsonIgnore public Optional getIsOpinion() { return isOpinion; } - @JsonProperty("is_paid_content") + @JsonIgnore public Optional getIsPaidContent() { return isPaidContent; } @@ -340,7 +340,7 @@ public Optional getIsPaidContent() { /** * @return The categorical URL(s) to filter your search. To filter your search by multiple categorical URLs, use a comma-separated string. */ - @JsonProperty("parent_url") + @JsonIgnore public Optional getParentUrl() { return parentUrl; } @@ -349,7 +349,7 @@ public Optional getParentUrl() { * @return The complete URL(s) mentioned in the article. For multiple URLs, use a comma-separated string. *

For more details, see Search by URL.

*/ - @JsonProperty("all_links") + @JsonIgnore public Optional getAllLinks() { return allLinks; } @@ -358,7 +358,7 @@ public Optional getAllLinks() { * @return The domain(s) mentioned in the article. For multiple domains, use a comma-separated string. *

For more details, see Search by URL.

*/ - @JsonProperty("all_domain_links") + @JsonIgnore public Optional getAllDomainLinks() { return allDomainLinks; } @@ -368,77 +368,77 @@ public Optional getAllDomainLinks() { *

Note: When this parameter is used, the response includes the all_links_data field with detailed link information.

*

To learn more, see Search by URL.

*/ - @JsonProperty("all_links_text") + @JsonIgnore public Optional getAllLinksText() { return allLinksText; } - @JsonProperty("word_count_min") + @JsonIgnore public Optional getWordCountMin() { return wordCountMin; } - @JsonProperty("word_count_max") + @JsonIgnore public Optional getWordCountMax() { return wordCountMax; } - @JsonProperty("page") + @JsonIgnore public Optional getPage() { return page; } - @JsonProperty("page_size") + @JsonIgnore public Optional getPageSize() { return pageSize; } - @JsonProperty("include_translation_fields") + @JsonIgnore public Optional getIncludeTranslationFields() { return includeTranslationFields; } - @JsonProperty("include_nlp_data") + @JsonIgnore public Optional getIncludeNlpData() { return includeNlpData; } - @JsonProperty("has_nlp") + @JsonIgnore public Optional getHasNlp() { return hasNlp; } - @JsonProperty("theme") + @JsonIgnore public Optional getTheme() { return theme; } - @JsonProperty("not_theme") + @JsonIgnore public Optional getNotTheme() { return notTheme; } - @JsonProperty("ner_name") + @JsonIgnore public Optional getNerName() { return nerName; } - @JsonProperty("title_sentiment_min") + @JsonIgnore public Optional getTitleSentimentMin() { return titleSentimentMin; } - @JsonProperty("title_sentiment_max") + @JsonIgnore public Optional getTitleSentimentMax() { return titleSentimentMax; } - @JsonProperty("content_sentiment_min") + @JsonIgnore public Optional getContentSentimentMin() { return contentSentimentMin; } - @JsonProperty("content_sentiment_max") + @JsonIgnore public Optional getContentSentimentMax() { return contentSentimentMax; } @@ -448,7 +448,7 @@ public Optional getContentSentimentMax() { *

Note: The iptc_tags parameter is only available in the v3_nlp_iptc_tags subscription plan.

*

To learn more, see IPTC Media Topic NewsCodes.

*/ - @JsonProperty("iptc_tags") + @JsonIgnore public Optional getIptcTags() { return iptcTags; } @@ -458,7 +458,7 @@ public Optional getIptcTags() { *

Note: The not_iptc_tags parameter is only available in the v3_nlp_iptc_tags subscription plan.

*

To learn more, see IPTC Media Topic NewsCodes.

*/ - @JsonProperty("not_iptc_tags") + @JsonIgnore public Optional getNotIptcTags() { return notIptcTags; } @@ -468,7 +468,7 @@ public Optional getNotIptcTags() { *

Note: The iab_tags parameter is only available in the v3_nlp_iptc_tags subscription plan.

*

To learn more, see the IAB Content taxonomy.

*/ - @JsonProperty("iab_tags") + @JsonIgnore public Optional getIabTags() { return iabTags; } @@ -478,7 +478,7 @@ public Optional getIabTags() { *

Note: The not_iab_tags parameter is only available in the v3_nlp_iptc_tags subscription plan.

*

To learn more, see the IAB Content taxonomy.

*/ - @JsonProperty("not_iab_tags") + @JsonIgnore public Optional getNotIabTags() { return notIabTags; } @@ -491,12 +491,12 @@ public Optional getNotIabTags() { *

Example: custom_tags.industry="Manufacturing,Logistics"

*

To learn more, see the Custom tags.

*/ - @JsonProperty("custom_tags") + @JsonIgnore public Optional getCustomTags() { return customTags; } - @JsonProperty("robots_compliant") + @JsonIgnore public Optional getRobotsCompliant() { return robotsCompliant; } diff --git a/src/main/java/com/newscatcher/api/resources/breakingnews/requests/GetBreakingNewsRequest.java b/src/main/java/com/newscatcher/api/resources/breakingnews/requests/GetBreakingNewsRequest.java index e8101ad..96765b0 100644 --- a/src/main/java/com/newscatcher/api/resources/breakingnews/requests/GetBreakingNewsRequest.java +++ b/src/main/java/com/newscatcher/api/resources/breakingnews/requests/GetBreakingNewsRequest.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; @@ -108,102 +108,102 @@ private GetBreakingNewsRequest( this.additionalProperties = additionalProperties; } - @JsonProperty("sort_by") + @JsonIgnore public Optional getSortBy() { return sortBy; } - @JsonProperty("ranked_only") + @JsonIgnore public Optional getRankedOnly() { return rankedOnly; } - @JsonProperty("from_rank") + @JsonIgnore public Optional getFromRank() { return fromRank; } - @JsonProperty("to_rank") + @JsonIgnore public Optional getToRank() { return toRank; } - @JsonProperty("page") + @JsonIgnore public Optional getPage() { return page; } - @JsonProperty("page_size") + @JsonIgnore public Optional getPageSize() { return pageSize; } - @JsonProperty("top_n_articles") + @JsonIgnore public Optional getTopNArticles() { return topNArticles; } - @JsonProperty("include_translation_fields") + @JsonIgnore public Optional getIncludeTranslationFields() { return includeTranslationFields; } - @JsonProperty("include_nlp_data") + @JsonIgnore public Optional getIncludeNlpData() { return includeNlpData; } - @JsonProperty("has_nlp") + @JsonIgnore public Optional getHasNlp() { return hasNlp; } - @JsonProperty("theme") + @JsonIgnore public Optional getTheme() { return theme; } - @JsonProperty("not_theme") + @JsonIgnore public Optional getNotTheme() { return notTheme; } - @JsonProperty("ORG_entity_name") + @JsonIgnore public Optional getOrgEntityName() { return orgEntityName; } - @JsonProperty("PER_entity_name") + @JsonIgnore public Optional getPerEntityName() { return perEntityName; } - @JsonProperty("LOC_entity_name") + @JsonIgnore public Optional getLocEntityName() { return locEntityName; } - @JsonProperty("MISC_entity_name") + @JsonIgnore public Optional getMiscEntityName() { return miscEntityName; } - @JsonProperty("title_sentiment_min") + @JsonIgnore public Optional getTitleSentimentMin() { return titleSentimentMin; } - @JsonProperty("title_sentiment_max") + @JsonIgnore public Optional getTitleSentimentMax() { return titleSentimentMax; } - @JsonProperty("content_sentiment_min") + @JsonIgnore public Optional getContentSentimentMin() { return contentSentimentMin; } - @JsonProperty("content_sentiment_max") + @JsonIgnore public Optional getContentSentimentMax() { return contentSentimentMax; } diff --git a/src/main/java/com/newscatcher/api/resources/latestheadlines/requests/GetLatestHeadlinesRequest.java b/src/main/java/com/newscatcher/api/resources/latestheadlines/requests/GetLatestHeadlinesRequest.java index e4b0e78..1c2266f 100644 --- a/src/main/java/com/newscatcher/api/resources/latestheadlines/requests/GetLatestHeadlinesRequest.java +++ b/src/main/java/com/newscatcher/api/resources/latestheadlines/requests/GetLatestHeadlinesRequest.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; @@ -209,17 +209,17 @@ private GetLatestHeadlinesRequest( this.additionalProperties = additionalProperties; } - @JsonProperty("when") + @JsonIgnore public Optional getWhen() { return when; } - @JsonProperty("by_parse_date") + @JsonIgnore public Optional getByParseDate() { return byParseDate; } - @JsonProperty("sort_by") + @JsonIgnore public Optional getSortBy() { return sortBy; } @@ -228,7 +228,7 @@ public Optional getSortBy() { * @return The language(s) of the search. The only accepted format is the two-letter ISO 639-1 code. To select multiple languages, use a comma-separated string. *

To learn more, see Enumerated parameters > Language.

*/ - @JsonProperty("lang") + @JsonIgnore public Optional getLang() { return lang; } @@ -237,7 +237,7 @@ public Optional getLang() { * @return The language(s) to exclude from the search. The accepted format is the two-letter ISO 639-1 code. To exclude multiple languages, use a comma-separated string. *

To learn more, see Enumerated parameters > Language.

*/ - @JsonProperty("not_lang") + @JsonIgnore public Optional getNotLang() { return notLang; } @@ -246,7 +246,7 @@ public Optional getNotLang() { * @return The countries where the news publisher is located. The accepted format is the two-letter ISO 3166-1 alpha-2 code. To select multiple countries, use a comma-separated string. *

To learn more, see Enumerated parameters > Country.

*/ - @JsonProperty("countries") + @JsonIgnore public Optional getCountries() { return countries; } @@ -255,7 +255,7 @@ public Optional getCountries() { * @return The publisher location countries to exclude from the search. The accepted format is the two-letter ISO 3166-1 alpha-2 code. To exclude multiple countries, use a comma-separated string. *

To learn more, see Enumerated parameters > Country.

*/ - @JsonProperty("not_countries") + @JsonIgnore public Optional getNotCountries() { return notCountries; } @@ -265,7 +265,7 @@ public Optional getNotCountries() { *

Format: start with the word top, followed by the number of desired sources, and then the two-letter country code ISO 3166-1 alpha-2.

*

Multiple countries with the number of top sources can be specified as a comma-separated string.

*/ - @JsonProperty("predefined_sources") + @JsonIgnore public Optional getPredefinedSources() { return predefinedSources; } @@ -273,7 +273,7 @@ public Optional getPredefinedSources() { /** * @return One or more news sources to narrow down the search. The format must be a domain URL. Subdomains, such as finance.yahoo.com, are also acceptable.To specify multiple sources, use a comma-separated string. */ - @JsonProperty("sources") + @JsonIgnore public Optional getSources() { return sources; } @@ -281,7 +281,7 @@ public Optional getSources() { /** * @return The news sources to exclude from the search. To exclude multiple sources, use a comma-separated string. */ - @JsonProperty("not_sources") + @JsonIgnore public Optional getNotSources() { return notSources; } @@ -289,27 +289,27 @@ public Optional getNotSources() { /** * @return The list of author names to exclude from your search. To exclude articles by specific authors, use a comma-separated string. */ - @JsonProperty("not_author_name") + @JsonIgnore public Optional getNotAuthorName() { return notAuthorName; } - @JsonProperty("ranked_only") + @JsonIgnore public Optional getRankedOnly() { return rankedOnly; } - @JsonProperty("is_headline") + @JsonIgnore public Optional getIsHeadline() { return isHeadline; } - @JsonProperty("is_opinion") + @JsonIgnore public Optional getIsOpinion() { return isOpinion; } - @JsonProperty("is_paid_content") + @JsonIgnore public Optional getIsPaidContent() { return isPaidContent; } @@ -317,7 +317,7 @@ public Optional getIsPaidContent() { /** * @return The categorical URL(s) to filter your search. To filter your search by multiple categorical URLs, use a comma-separated string. */ - @JsonProperty("parent_url") + @JsonIgnore public Optional getParentUrl() { return parentUrl; } @@ -326,7 +326,7 @@ public Optional getParentUrl() { * @return The complete URL(s) mentioned in the article. For multiple URLs, use a comma-separated string. *

For more details, see Search by URL.

*/ - @JsonProperty("all_links") + @JsonIgnore public Optional getAllLinks() { return allLinks; } @@ -335,7 +335,7 @@ public Optional getAllLinks() { * @return The domain(s) mentioned in the article. For multiple domains, use a comma-separated string. *

For more details, see Search by URL.

*/ - @JsonProperty("all_domain_links") + @JsonIgnore public Optional getAllDomainLinks() { return allDomainLinks; } @@ -345,107 +345,107 @@ public Optional getAllDomainLinks() { *

Note: When this parameter is used, the response includes the all_links_data field with detailed link information.

*

To learn more, see Search by URL.

*/ - @JsonProperty("all_links_text") + @JsonIgnore public Optional getAllLinksText() { return allLinksText; } - @JsonProperty("word_count_min") + @JsonIgnore public Optional getWordCountMin() { return wordCountMin; } - @JsonProperty("word_count_max") + @JsonIgnore public Optional getWordCountMax() { return wordCountMax; } - @JsonProperty("page") + @JsonIgnore public Optional getPage() { return page; } - @JsonProperty("page_size") + @JsonIgnore public Optional getPageSize() { return pageSize; } - @JsonProperty("clustering_enabled") + @JsonIgnore public Optional getClusteringEnabled() { return clusteringEnabled; } - @JsonProperty("clustering_variable") + @JsonIgnore public Optional getClusteringVariable() { return clusteringVariable; } - @JsonProperty("clustering_threshold") + @JsonIgnore public Optional getClusteringThreshold() { return clusteringThreshold; } - @JsonProperty("include_translation_fields") + @JsonIgnore public Optional getIncludeTranslationFields() { return includeTranslationFields; } - @JsonProperty("include_nlp_data") + @JsonIgnore public Optional getIncludeNlpData() { return includeNlpData; } - @JsonProperty("has_nlp") + @JsonIgnore public Optional getHasNlp() { return hasNlp; } - @JsonProperty("theme") + @JsonIgnore public Optional getTheme() { return theme; } - @JsonProperty("not_theme") + @JsonIgnore public Optional getNotTheme() { return notTheme; } - @JsonProperty("ORG_entity_name") + @JsonIgnore public Optional getOrgEntityName() { return orgEntityName; } - @JsonProperty("PER_entity_name") + @JsonIgnore public Optional getPerEntityName() { return perEntityName; } - @JsonProperty("LOC_entity_name") + @JsonIgnore public Optional getLocEntityName() { return locEntityName; } - @JsonProperty("MISC_entity_name") + @JsonIgnore public Optional getMiscEntityName() { return miscEntityName; } - @JsonProperty("title_sentiment_min") + @JsonIgnore public Optional getTitleSentimentMin() { return titleSentimentMin; } - @JsonProperty("title_sentiment_max") + @JsonIgnore public Optional getTitleSentimentMax() { return titleSentimentMax; } - @JsonProperty("content_sentiment_min") + @JsonIgnore public Optional getContentSentimentMin() { return contentSentimentMin; } - @JsonProperty("content_sentiment_max") + @JsonIgnore public Optional getContentSentimentMax() { return contentSentimentMax; } @@ -455,7 +455,7 @@ public Optional getContentSentimentMax() { *

Note: The iptc_tags parameter is only available in the v3_nlp_iptc_tags subscription plan.

*

To learn more, see IPTC Media Topic NewsCodes.

*/ - @JsonProperty("iptc_tags") + @JsonIgnore public Optional getIptcTags() { return iptcTags; } @@ -465,7 +465,7 @@ public Optional getIptcTags() { *

Note: The not_iptc_tags parameter is only available in the v3_nlp_iptc_tags subscription plan.

*

To learn more, see IPTC Media Topic NewsCodes.

*/ - @JsonProperty("not_iptc_tags") + @JsonIgnore public Optional getNotIptcTags() { return notIptcTags; } @@ -475,7 +475,7 @@ public Optional getNotIptcTags() { *

Note: The iab_tags parameter is only available in the v3_nlp_iptc_tags subscription plan.

*

To learn more, see the IAB Content taxonomy.

*/ - @JsonProperty("iab_tags") + @JsonIgnore public Optional getIabTags() { return iabTags; } @@ -485,7 +485,7 @@ public Optional getIabTags() { *

Note: The not_iab_tags parameter is only available in the v3_nlp_iptc_tags subscription plan.

*

To learn more, see the IAB Content taxonomy.

*/ - @JsonProperty("not_iab_tags") + @JsonIgnore public Optional getNotIabTags() { return notIabTags; } @@ -498,12 +498,12 @@ public Optional getNotIabTags() { *

Example: custom_tags.industry="Manufacturing,Logistics"

*

To learn more, see the Custom tags.

*/ - @JsonProperty("custom_tags") + @JsonIgnore public Optional getCustomTags() { return customTags; } - @JsonProperty("robots_compliant") + @JsonIgnore public Optional getRobotsCompliant() { return robotsCompliant; } diff --git a/src/main/java/com/newscatcher/api/resources/search/requests/GetSearchRequest.java b/src/main/java/com/newscatcher/api/resources/search/requests/GetSearchRequest.java index 35f5f53..8742f76 100644 --- a/src/main/java/com/newscatcher/api/resources/search/requests/GetSearchRequest.java +++ b/src/main/java/com/newscatcher/api/resources/search/requests/GetSearchRequest.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; @@ -261,17 +261,17 @@ private GetSearchRequest( this.additionalProperties = additionalProperties; } - @JsonProperty("q") + @JsonIgnore public String getQ() { return q; } - @JsonProperty("search_in") + @JsonIgnore public Optional getSearchIn() { return searchIn; } - @JsonProperty("include_translation_fields") + @JsonIgnore public Optional getIncludeTranslationFields() { return includeTranslationFields; } @@ -281,7 +281,7 @@ public Optional getIncludeTranslationFields() { *

Format: start with the word top, followed by the number of desired sources, and then the two-letter country code ISO 3166-1 alpha-2.

*

Multiple countries with the number of top sources can be specified as a comma-separated string.

*/ - @JsonProperty("predefined_sources") + @JsonIgnore public Optional getPredefinedSources() { return predefinedSources; } @@ -290,7 +290,7 @@ public Optional getPredefinedSources() { * @return Word or phrase to search within the source names. To specify multiple values, use a comma-separated string. *

Note: The search doesn't require an exact match and returns sources containing the specified terms in their names. You can use any word or phrase, like "sport" or "new york times". For example, "sport" returns sources such as "Motorsport", "Dot Esport", and "Tuttosport".

*/ - @JsonProperty("source_name") + @JsonIgnore public Optional getSourceName() { return sourceName; } @@ -298,7 +298,7 @@ public Optional getSourceName() { /** * @return One or more news sources to narrow down the search. The format must be a domain URL. Subdomains, such as finance.yahoo.com, are also acceptable.To specify multiple sources, use a comma-separated string. */ - @JsonProperty("sources") + @JsonIgnore public Optional getSources() { return sources; } @@ -306,7 +306,7 @@ public Optional getSources() { /** * @return The news sources to exclude from the search. To exclude multiple sources, use a comma-separated string. */ - @JsonProperty("not_sources") + @JsonIgnore public Optional getNotSources() { return notSources; } @@ -315,7 +315,7 @@ public Optional getNotSources() { * @return The language(s) of the search. The only accepted format is the two-letter ISO 639-1 code. To select multiple languages, use a comma-separated string. *

To learn more, see Enumerated parameters > Language.

*/ - @JsonProperty("lang") + @JsonIgnore public Optional getLang() { return lang; } @@ -324,7 +324,7 @@ public Optional getLang() { * @return The language(s) to exclude from the search. The accepted format is the two-letter ISO 639-1 code. To exclude multiple languages, use a comma-separated string. *

To learn more, see Enumerated parameters > Language.

*/ - @JsonProperty("not_lang") + @JsonIgnore public Optional getNotLang() { return notLang; } @@ -333,7 +333,7 @@ public Optional getNotLang() { * @return The countries where the news publisher is located. The accepted format is the two-letter ISO 3166-1 alpha-2 code. To select multiple countries, use a comma-separated string. *

To learn more, see Enumerated parameters > Country.

*/ - @JsonProperty("countries") + @JsonIgnore public Optional getCountries() { return countries; } @@ -342,7 +342,7 @@ public Optional getCountries() { * @return The publisher location countries to exclude from the search. The accepted format is the two-letter ISO 3166-1 alpha-2 code. To exclude multiple countries, use a comma-separated string. *

To learn more, see Enumerated parameters > Country.

*/ - @JsonProperty("not_countries") + @JsonIgnore public Optional getNotCountries() { return notCountries; } @@ -350,62 +350,62 @@ public Optional getNotCountries() { /** * @return The list of author names to exclude from your search. To exclude articles by specific authors, use a comma-separated string. */ - @JsonProperty("not_author_name") + @JsonIgnore public Optional getNotAuthorName() { return notAuthorName; } - @JsonProperty("from_") + @JsonIgnore public Optional getFrom() { return from; } - @JsonProperty("to_") + @JsonIgnore public Optional getTo() { return to; } - @JsonProperty("published_date_precision") + @JsonIgnore public Optional getPublishedDatePrecision() { return publishedDatePrecision; } - @JsonProperty("by_parse_date") + @JsonIgnore public Optional getByParseDate() { return byParseDate; } - @JsonProperty("sort_by") + @JsonIgnore public Optional getSortBy() { return sortBy; } - @JsonProperty("ranked_only") + @JsonIgnore public Optional getRankedOnly() { return rankedOnly; } - @JsonProperty("from_rank") + @JsonIgnore public Optional getFromRank() { return fromRank; } - @JsonProperty("to_rank") + @JsonIgnore public Optional getToRank() { return toRank; } - @JsonProperty("is_headline") + @JsonIgnore public Optional getIsHeadline() { return isHeadline; } - @JsonProperty("is_opinion") + @JsonIgnore public Optional getIsOpinion() { return isOpinion; } - @JsonProperty("is_paid_content") + @JsonIgnore public Optional getIsPaidContent() { return isPaidContent; } @@ -413,7 +413,7 @@ public Optional getIsPaidContent() { /** * @return The categorical URL(s) to filter your search. To filter your search by multiple categorical URLs, use a comma-separated string. */ - @JsonProperty("parent_url") + @JsonIgnore public Optional getParentUrl() { return parentUrl; } @@ -422,7 +422,7 @@ public Optional getParentUrl() { * @return The complete URL(s) mentioned in the article. For multiple URLs, use a comma-separated string. *

For more details, see Search by URL.

*/ - @JsonProperty("all_links") + @JsonIgnore public Optional getAllLinks() { return allLinks; } @@ -431,7 +431,7 @@ public Optional getAllLinks() { * @return The domain(s) mentioned in the article. For multiple domains, use a comma-separated string. *

For more details, see Search by URL.

*/ - @JsonProperty("all_domain_links") + @JsonIgnore public Optional getAllDomainLinks() { return allDomainLinks; } @@ -441,22 +441,22 @@ public Optional getAllDomainLinks() { *

Note: When this parameter is used, the response includes the all_links_data field with detailed link information.

*

To learn more, see Search by URL.

*/ - @JsonProperty("all_links_text") + @JsonIgnore public Optional getAllLinksText() { return allLinksText; } - @JsonProperty("additional_domain_info") + @JsonIgnore public Optional getAdditionalDomainInfo() { return additionalDomainInfo; } - @JsonProperty("is_news_domain") + @JsonIgnore public Optional getIsNewsDomain() { return isNewsDomain; } - @JsonProperty("news_domain_type") + @JsonIgnore public Optional getNewsDomainType() { return newsDomainType; } @@ -465,102 +465,102 @@ public Optional getNewsDomainType() { * @return Filters results based on the news type. Multiple types can be specified using a comma-separated string. *

For a complete list of available news types, see Enumerated parameters > News type.

*/ - @JsonProperty("news_type") + @JsonIgnore public Optional getNewsType() { return newsType; } - @JsonProperty("word_count_min") + @JsonIgnore public Optional getWordCountMin() { return wordCountMin; } - @JsonProperty("word_count_max") + @JsonIgnore public Optional getWordCountMax() { return wordCountMax; } - @JsonProperty("page") + @JsonIgnore public Optional getPage() { return page; } - @JsonProperty("page_size") + @JsonIgnore public Optional getPageSize() { return pageSize; } - @JsonProperty("clustering_enabled") + @JsonIgnore public Optional getClusteringEnabled() { return clusteringEnabled; } - @JsonProperty("clustering_variable") + @JsonIgnore public Optional getClusteringVariable() { return clusteringVariable; } - @JsonProperty("clustering_threshold") + @JsonIgnore public Optional getClusteringThreshold() { return clusteringThreshold; } - @JsonProperty("include_nlp_data") + @JsonIgnore public Optional getIncludeNlpData() { return includeNlpData; } - @JsonProperty("has_nlp") + @JsonIgnore public Optional getHasNlp() { return hasNlp; } - @JsonProperty("theme") + @JsonIgnore public Optional getTheme() { return theme; } - @JsonProperty("not_theme") + @JsonIgnore public Optional getNotTheme() { return notTheme; } - @JsonProperty("ORG_entity_name") + @JsonIgnore public Optional getOrgEntityName() { return orgEntityName; } - @JsonProperty("PER_entity_name") + @JsonIgnore public Optional getPerEntityName() { return perEntityName; } - @JsonProperty("LOC_entity_name") + @JsonIgnore public Optional getLocEntityName() { return locEntityName; } - @JsonProperty("MISC_entity_name") + @JsonIgnore public Optional getMiscEntityName() { return miscEntityName; } - @JsonProperty("title_sentiment_min") + @JsonIgnore public Optional getTitleSentimentMin() { return titleSentimentMin; } - @JsonProperty("title_sentiment_max") + @JsonIgnore public Optional getTitleSentimentMax() { return titleSentimentMax; } - @JsonProperty("content_sentiment_min") + @JsonIgnore public Optional getContentSentimentMin() { return contentSentimentMin; } - @JsonProperty("content_sentiment_max") + @JsonIgnore public Optional getContentSentimentMax() { return contentSentimentMax; } @@ -570,7 +570,7 @@ public Optional getContentSentimentMax() { *

Note: The iptc_tags parameter is only available in the v3_nlp_iptc_tags subscription plan.

*

To learn more, see IPTC Media Topic NewsCodes.

*/ - @JsonProperty("iptc_tags") + @JsonIgnore public Optional getIptcTags() { return iptcTags; } @@ -580,7 +580,7 @@ public Optional getIptcTags() { *

Note: The not_iptc_tags parameter is only available in the v3_nlp_iptc_tags subscription plan.

*

To learn more, see IPTC Media Topic NewsCodes.

*/ - @JsonProperty("not_iptc_tags") + @JsonIgnore public Optional getNotIptcTags() { return notIptcTags; } @@ -590,7 +590,7 @@ public Optional getNotIptcTags() { *

Note: The iab_tags parameter is only available in the v3_nlp_iptc_tags subscription plan.

*

To learn more, see the IAB Content taxonomy.

*/ - @JsonProperty("iab_tags") + @JsonIgnore public Optional getIabTags() { return iabTags; } @@ -600,7 +600,7 @@ public Optional getIabTags() { *

Note: The not_iab_tags parameter is only available in the v3_nlp_iptc_tags subscription plan.

*

To learn more, see the IAB Content taxonomy.

*/ - @JsonProperty("not_iab_tags") + @JsonIgnore public Optional getNotIabTags() { return notIabTags; } @@ -613,17 +613,17 @@ public Optional getNotIabTags() { *

Example: custom_tags.industry="Manufacturing,Logistics"

*

To learn more, see the Custom tags.

*/ - @JsonProperty("custom_tags") + @JsonIgnore public Optional getCustomTags() { return customTags; } - @JsonProperty("exclude_duplicates") + @JsonIgnore public Optional getExcludeDuplicates() { return excludeDuplicates; } - @JsonProperty("robots_compliant") + @JsonIgnore public Optional getRobotsCompliant() { return robotsCompliant; } diff --git a/src/main/java/com/newscatcher/api/resources/searchbylink/requests/GetSearchByLinkRequest.java b/src/main/java/com/newscatcher/api/resources/searchbylink/requests/GetSearchByLinkRequest.java index 5979dae..a51c2df 100644 --- a/src/main/java/com/newscatcher/api/resources/searchbylink/requests/GetSearchByLinkRequest.java +++ b/src/main/java/com/newscatcher/api/resources/searchbylink/requests/GetSearchByLinkRequest.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; @@ -61,7 +61,7 @@ private GetSearchByLinkRequest( * @return The Newscatcher article ID (corresponds to the _id field in API response) or a list of article IDs to search for. To specify multiple IDs, use a comma-separated string. *

Caution: You can use either the links or the ids parameter, but not both at the same time.

*/ - @JsonProperty("ids") + @JsonIgnore public Optional getIds() { return ids; } @@ -70,32 +70,32 @@ public Optional getIds() { * @return The article link or list of article links to search for. To specify multiple links, use a comma-separated string. *

Caution: You can use either the links or the ids parameter, but not both at the same time.

*/ - @JsonProperty("links") + @JsonIgnore public Optional getLinks() { return links; } - @JsonProperty("from_") + @JsonIgnore public Optional getFrom() { return from; } - @JsonProperty("to_") + @JsonIgnore public Optional getTo() { return to; } - @JsonProperty("page") + @JsonIgnore public Optional getPage() { return page; } - @JsonProperty("page_size") + @JsonIgnore public Optional getPageSize() { return pageSize; } - @JsonProperty("robots_compliant") + @JsonIgnore public Optional getRobotsCompliant() { return robotsCompliant; } diff --git a/src/main/java/com/newscatcher/api/resources/sources/requests/GetSourcesRequest.java b/src/main/java/com/newscatcher/api/resources/sources/requests/GetSourcesRequest.java index dc46b6d..c7c6e35 100644 --- a/src/main/java/com/newscatcher/api/resources/sources/requests/GetSourcesRequest.java +++ b/src/main/java/com/newscatcher/api/resources/sources/requests/GetSourcesRequest.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; @@ -76,7 +76,7 @@ private GetSourcesRequest( * @return The language(s) of the search. The only accepted format is the two-letter ISO 639-1 code. To select multiple languages, use a comma-separated string. *

To learn more, see Enumerated parameters > Language.

*/ - @JsonProperty("lang") + @JsonIgnore public Optional getLang() { return lang; } @@ -85,7 +85,7 @@ public Optional getLang() { * @return The countries where the news publisher is located. The accepted format is the two-letter ISO 3166-1 alpha-2 code. To select multiple countries, use a comma-separated string. *

To learn more, see Enumerated parameters > Country.

*/ - @JsonProperty("countries") + @JsonIgnore public Optional getCountries() { return countries; } @@ -95,7 +95,7 @@ public Optional getCountries() { *

Format: start with the word top, followed by the number of desired sources, and then the two-letter country code ISO 3166-1 alpha-2.

*

Multiple countries with the number of top sources can be specified as a comma-separated string.

*/ - @JsonProperty("predefined_sources") + @JsonIgnore public Optional getPredefinedSources() { return predefinedSources; } @@ -104,7 +104,7 @@ public Optional getPredefinedSources() { * @return Word or phrase to search within the source names. To specify multiple values, use a comma-separated string. *

Note: The search doesn't require an exact match and returns sources containing the specified terms in their names. You can use any word or phrase, like "sport" or "new york times". For example, "sport" returns sources such as "Motorsport", "Dot Esport", and "Tuttosport".

*/ - @JsonProperty("source_name") + @JsonIgnore public Optional getSourceName() { return sourceName; } @@ -114,22 +114,22 @@ public Optional getSourceName() { *

Caution: When specifying the source_url parameter, * you can only use include_additional_info as an extra parameter.

*/ - @JsonProperty("source_url") + @JsonIgnore public Optional getSourceUrl() { return sourceUrl; } - @JsonProperty("include_additional_info") + @JsonIgnore public Optional getIncludeAdditionalInfo() { return includeAdditionalInfo; } - @JsonProperty("is_news_domain") + @JsonIgnore public Optional getIsNewsDomain() { return isNewsDomain; } - @JsonProperty("news_domain_type") + @JsonIgnore public Optional getNewsDomainType() { return newsDomainType; } @@ -138,17 +138,17 @@ public Optional getNewsDomainType() { * @return Filters results based on the news type. Multiple types can be specified using a comma-separated string. *

For a complete list of available news types, see Enumerated parameters > News type.

*/ - @JsonProperty("news_type") + @JsonIgnore public Optional getNewsType() { return newsType; } - @JsonProperty("from_rank") + @JsonIgnore public Optional getFromRank() { return fromRank; } - @JsonProperty("to_rank") + @JsonIgnore public Optional getToRank() { return toRank; } diff --git a/src/main/java/com/newscatcher/api/types/NewsDomainType.java b/src/main/java/com/newscatcher/api/types/NewsDomainType.java index 488835c..739d969 100644 --- a/src/main/java/com/newscatcher/api/types/NewsDomainType.java +++ b/src/main/java/com/newscatcher/api/types/NewsDomainType.java @@ -7,17 +7,17 @@ import com.fasterxml.jackson.annotation.JsonValue; public final class NewsDomainType { + public static final NewsDomainType AGGREGATOR = new NewsDomainType(Value.AGGREGATOR, "Aggregator"); + public static final NewsDomainType PRESS_RELEASES = new NewsDomainType(Value.PRESS_RELEASES, "Press Releases"); - public static final NewsDomainType AGGREGATOR = new NewsDomainType(Value.AGGREGATOR, "Aggregator"); + public static final NewsDomainType ORIGINAL_CONTENT = + new NewsDomainType(Value.ORIGINAL_CONTENT, "Original Content"); public static final NewsDomainType REPUBLISHER = new NewsDomainType(Value.REPUBLISHER, "Republisher"); public static final NewsDomainType OTHER = new NewsDomainType(Value.OTHER, "Other"); - public static final NewsDomainType ORIGINAL_CONTENT = - new NewsDomainType(Value.ORIGINAL_CONTENT, "Original Content"); - private final Value value; private final String string; @@ -50,16 +50,16 @@ public int hashCode() { public T visit(Visitor visitor) { switch (value) { - case PRESS_RELEASES: - return visitor.visitPressReleases(); case AGGREGATOR: return visitor.visitAggregator(); + case PRESS_RELEASES: + return visitor.visitPressReleases(); + case ORIGINAL_CONTENT: + return visitor.visitOriginalContent(); case REPUBLISHER: return visitor.visitRepublisher(); case OTHER: return visitor.visitOther(); - case ORIGINAL_CONTENT: - return visitor.visitOriginalContent(); case UNKNOWN: default: return visitor.visitUnknown(string); @@ -69,16 +69,16 @@ public T visit(Visitor visitor) { @JsonCreator(mode = JsonCreator.Mode.DELEGATING) public static NewsDomainType valueOf(String value) { switch (value) { - case "Press Releases": - return PRESS_RELEASES; case "Aggregator": return AGGREGATOR; + case "Press Releases": + return PRESS_RELEASES; + case "Original Content": + return ORIGINAL_CONTENT; case "Republisher": return REPUBLISHER; case "Other": return OTHER; - case "Original Content": - return ORIGINAL_CONTENT; default: return new NewsDomainType(Value.UNKNOWN, value); } diff --git a/src/main/java/com/newscatcher/api/types/NlpDataEntity.java b/src/main/java/com/newscatcher/api/types/NlpDataEntity.java index 3115d0c..fd041a2 100644 --- a/src/main/java/com/newscatcher/api/types/NlpDataEntity.java +++ b/src/main/java/com/newscatcher/api/types/NlpDataEntity.java @@ -31,6 +31,8 @@ public final class NlpDataEntity { private final Optional> newEmbedding; + private final Optional> qwenEmbedding; + private final Optional> nerPer; private final Optional> nerOrg; @@ -61,6 +63,7 @@ private NlpDataEntity( Optional summary, Optional sentiment, Optional> newEmbedding, + Optional> qwenEmbedding, Optional> nerPer, Optional> nerOrg, Optional> nerMisc, @@ -78,6 +81,7 @@ private NlpDataEntity( this.summary = summary; this.sentiment = sentiment; this.newEmbedding = newEmbedding; + this.qwenEmbedding = qwenEmbedding; this.nerPer = nerPer; this.nerOrg = nerOrg; this.nerMisc = nerMisc; @@ -122,7 +126,7 @@ public Optional getSentiment() { } /** - * @return A dense 1024-dimensional vector representation of the article content, generated using the multilingual-e5-large model. + * @return A dense 1024-dimensional vector representation of the article content, generated using the multilingual-e5-large model. Available for articles indexed before January 1, 2026. *

Note: The new_embedding field is only available in the v3_nlp_embeddings subscription plan.

*/ @JsonProperty("new_embedding") @@ -130,6 +134,15 @@ public Optional> getNewEmbedding() { return newEmbedding; } + /** + * @return A dense 1024-dimensional vector representation of the article content, generated using the Qwen3-Embedding-0.6B model. Available for articles indexed from January 1, 2026 onward. Embeddings are computed from a combination of the article title and content fields. + *

Note: The qwen_embedding field is only available in the v3_nlp_embeddings subscription plan.

+ */ + @JsonProperty("qwen_embedding") + public Optional> getQwenEmbedding() { + return qwenEmbedding; + } + /** * @return Named Entity Recognition for person entities (individuals' names). */ @@ -238,6 +251,7 @@ private boolean equalTo(NlpDataEntity other) { && summary.equals(other.summary) && sentiment.equals(other.sentiment) && newEmbedding.equals(other.newEmbedding) + && qwenEmbedding.equals(other.qwenEmbedding) && nerPer.equals(other.nerPer) && nerOrg.equals(other.nerOrg) && nerMisc.equals(other.nerMisc) @@ -259,6 +273,7 @@ public int hashCode() { this.summary, this.sentiment, this.newEmbedding, + this.qwenEmbedding, this.nerPer, this.nerOrg, this.nerMisc, @@ -293,6 +308,8 @@ public static final class Builder { private Optional> newEmbedding = Optional.empty(); + private Optional> qwenEmbedding = Optional.empty(); + private Optional> nerPer = Optional.empty(); private Optional> nerOrg = Optional.empty(); @@ -326,6 +343,7 @@ public Builder from(NlpDataEntity other) { summary(other.getSummary()); sentiment(other.getSentiment()); newEmbedding(other.getNewEmbedding()); + qwenEmbedding(other.getQwenEmbedding()); nerPer(other.getNerPer()); nerOrg(other.getNerOrg()); nerMisc(other.getNerMisc()); @@ -394,7 +412,7 @@ public Builder sentiment(SentimentScores sentiment) { } /** - *

A dense 1024-dimensional vector representation of the article content, generated using the multilingual-e5-large model.

+ *

A dense 1024-dimensional vector representation of the article content, generated using the multilingual-e5-large model. Available for articles indexed before January 1, 2026.

*

Note: The new_embedding field is only available in the v3_nlp_embeddings subscription plan.

*/ @JsonSetter(value = "new_embedding", nulls = Nulls.SKIP) @@ -408,6 +426,21 @@ public Builder newEmbedding(List newEmbedding) { return this; } + /** + *

A dense 1024-dimensional vector representation of the article content, generated using the Qwen3-Embedding-0.6B model. Available for articles indexed from January 1, 2026 onward. Embeddings are computed from a combination of the article title and content fields.

+ *

Note: The qwen_embedding field is only available in the v3_nlp_embeddings subscription plan.

+ */ + @JsonSetter(value = "qwen_embedding", nulls = Nulls.SKIP) + public Builder qwenEmbedding(Optional> qwenEmbedding) { + this.qwenEmbedding = qwenEmbedding; + return this; + } + + public Builder qwenEmbedding(List qwenEmbedding) { + this.qwenEmbedding = Optional.ofNullable(qwenEmbedding); + return this; + } + /** *

Named Entity Recognition for person entities (individuals' names).

*/ @@ -572,6 +605,7 @@ public NlpDataEntity build() { summary, sentiment, newEmbedding, + qwenEmbedding, nerPer, nerOrg, nerMisc, diff --git a/src/main/java/com/newscatcher/api/types/SortBy.java b/src/main/java/com/newscatcher/api/types/SortBy.java index a55ccef..26cd0a0 100644 --- a/src/main/java/com/newscatcher/api/types/SortBy.java +++ b/src/main/java/com/newscatcher/api/types/SortBy.java @@ -9,10 +9,10 @@ public final class SortBy { public static final SortBy RANK = new SortBy(Value.RANK, "rank"); - public static final SortBy DATE = new SortBy(Value.DATE, "date"); - public static final SortBy RELEVANCY = new SortBy(Value.RELEVANCY, "relevancy"); + public static final SortBy DATE = new SortBy(Value.DATE, "date"); + private final Value value; private final String string; @@ -46,10 +46,10 @@ public T visit(Visitor visitor) { switch (value) { case RANK: return visitor.visitRank(); - case DATE: - return visitor.visitDate(); case RELEVANCY: return visitor.visitRelevancy(); + case DATE: + return visitor.visitDate(); case UNKNOWN: default: return visitor.visitUnknown(string); @@ -61,10 +61,10 @@ public static SortBy valueOf(String value) { switch (value) { case "rank": return RANK; - case "date": - return DATE; case "relevancy": return RELEVANCY; + case "date": + return DATE; default: return new SortBy(Value.UNKNOWN, value); }