All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.konfigthis.newscatcherapi.client.model.MoreLikeThisRequest Maven / Gradle / Ivy

There is a newer version: 6.0.13
Show newest version
/*
 * NewsCatcher-V3 Production API
 *  

Visit our website https://newscatcherapi.com * * The version of the OpenAPI document: 3.2.16 * Contact: [email protected] * * NOTE: This class is auto generated by Konfig (https://konfigthis.com). * Do not edit the class manually. */ package com.konfigthis.newscatcherapi.client.model; import java.util.Objects; import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import org.openapitools.jackson.nullable.JsonNullable; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonParseException; import com.google.gson.TypeAdapterFactory; import com.google.gson.reflect.TypeToken; import org.apache.commons.lang3.StringUtils; import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.Set; import com.konfigthis.newscatcherapi.client.JSON; /** * More like this request DTO. */ @ApiModel(description = "More like this request DTO.")@javax.annotation.Generated(value = "Generated by https://konfigthis.com") public class MoreLikeThisRequest { public static final String SERIALIZED_NAME_Q = "q"; @SerializedName(SERIALIZED_NAME_Q) private String q; public static final String SERIALIZED_NAME_SEARCH_IN = "search_in"; @SerializedName(SERIALIZED_NAME_SEARCH_IN) private String searchIn = "title_content"; public static final String SERIALIZED_NAME_INCLUDE_SIMILAR_DOCUMENTS = "include_similar_documents"; @SerializedName(SERIALIZED_NAME_INCLUDE_SIMILAR_DOCUMENTS) private Boolean includeSimilarDocuments = false; public static final String SERIALIZED_NAME_SIMILAR_DOCUMENTS_NUMBER = "similar_documents_number"; @SerializedName(SERIALIZED_NAME_SIMILAR_DOCUMENTS_NUMBER) private Integer similarDocumentsNumber = 5; public static final String SERIALIZED_NAME_SIMILAR_DOCUMENTS_FIELDS = "similar_documents_fields"; @SerializedName(SERIALIZED_NAME_SIMILAR_DOCUMENTS_FIELDS) private String similarDocumentsFields = "title,content"; public static final String SERIALIZED_NAME_PREDEFINED_SOURCES = "predefined_sources"; @SerializedName(SERIALIZED_NAME_PREDEFINED_SOURCES) private Object predefinedSources = null; public static final String SERIALIZED_NAME_SOURCES = "sources"; @SerializedName(SERIALIZED_NAME_SOURCES) private Object sources = null; public static final String SERIALIZED_NAME_NOT_SOURCES = "not_sources"; @SerializedName(SERIALIZED_NAME_NOT_SOURCES) private Object notSources = null; public static final String SERIALIZED_NAME_LANG = "lang"; @SerializedName(SERIALIZED_NAME_LANG) private Object lang = null; public static final String SERIALIZED_NAME_NOT_LANG = "not_lang"; @SerializedName(SERIALIZED_NAME_NOT_LANG) private Object notLang = null; public static final String SERIALIZED_NAME_COUNTRIES = "countries"; @SerializedName(SERIALIZED_NAME_COUNTRIES) private Object countries = null; public static final String SERIALIZED_NAME_NOT_COUNTRIES = "not_countries"; @SerializedName(SERIALIZED_NAME_NOT_COUNTRIES) private Object notCountries = null; public static final String SERIALIZED_NAME_FROM = "from_"; @SerializedName(SERIALIZED_NAME_FROM) private String from; public static final String SERIALIZED_NAME_TO = "to_"; @SerializedName(SERIALIZED_NAME_TO) private String to; public static final String SERIALIZED_NAME_BY_PARSE_DATE = "by_parse_date"; @SerializedName(SERIALIZED_NAME_BY_PARSE_DATE) private Boolean byParseDate = false; public static final String SERIALIZED_NAME_PUBLISHED_DATE_PRECISION = "published_date_precision"; @SerializedName(SERIALIZED_NAME_PUBLISHED_DATE_PRECISION) private String publishedDatePrecision; public static final String SERIALIZED_NAME_SORT_BY = "sort_by"; @SerializedName(SERIALIZED_NAME_SORT_BY) private String sortBy = "relevancy"; public static final String SERIALIZED_NAME_RANKED_ONLY = "ranked_only"; @SerializedName(SERIALIZED_NAME_RANKED_ONLY) private Object rankedOnly = null; public static final String SERIALIZED_NAME_FROM_RANK = "from_rank"; @SerializedName(SERIALIZED_NAME_FROM_RANK) private Integer fromRank; public static final String SERIALIZED_NAME_TO_RANK = "to_rank"; @SerializedName(SERIALIZED_NAME_TO_RANK) private Integer toRank; public static final String SERIALIZED_NAME_IS_HEADLINE = "is_headline"; @SerializedName(SERIALIZED_NAME_IS_HEADLINE) private Boolean isHeadline; public static final String SERIALIZED_NAME_IS_OPINION = "is_opinion"; @SerializedName(SERIALIZED_NAME_IS_OPINION) private Boolean isOpinion; public static final String SERIALIZED_NAME_IS_PAID_CONTENT = "is_paid_content"; @SerializedName(SERIALIZED_NAME_IS_PAID_CONTENT) private Boolean isPaidContent; public static final String SERIALIZED_NAME_PARENT_URL = "parent_url"; @SerializedName(SERIALIZED_NAME_PARENT_URL) private Object parentUrl = null; public static final String SERIALIZED_NAME_ALL_LINKS = "all_links"; @SerializedName(SERIALIZED_NAME_ALL_LINKS) private Object allLinks = null; public static final String SERIALIZED_NAME_ALL_DOMAIN_LINKS = "all_domain_links"; @SerializedName(SERIALIZED_NAME_ALL_DOMAIN_LINKS) private Object allDomainLinks = null; public static final String SERIALIZED_NAME_WORD_COUNT_MIN = "word_count_min"; @SerializedName(SERIALIZED_NAME_WORD_COUNT_MIN) private Integer wordCountMin; public static final String SERIALIZED_NAME_WORD_COUNT_MAX = "word_count_max"; @SerializedName(SERIALIZED_NAME_WORD_COUNT_MAX) private Integer wordCountMax; public static final String SERIALIZED_NAME_PAGE = "page"; @SerializedName(SERIALIZED_NAME_PAGE) private Integer page = 1; public static final String SERIALIZED_NAME_PAGE_SIZE = "page_size"; @SerializedName(SERIALIZED_NAME_PAGE_SIZE) private Integer pageSize = 100; public static final String SERIALIZED_NAME_INCLUDE_NLP_DATA = "include_nlp_data"; @SerializedName(SERIALIZED_NAME_INCLUDE_NLP_DATA) private Boolean includeNlpData; public static final String SERIALIZED_NAME_HAS_NLP = "has_nlp"; @SerializedName(SERIALIZED_NAME_HAS_NLP) private Boolean hasNlp; public static final String SERIALIZED_NAME_THEME = "theme"; @SerializedName(SERIALIZED_NAME_THEME) private String theme; public static final String SERIALIZED_NAME_NOT_THEME = "not_theme"; @SerializedName(SERIALIZED_NAME_NOT_THEME) private String notTheme; public static final String SERIALIZED_NAME_TITLE_SENTIMENT_MIN = "title_sentiment_min"; @SerializedName(SERIALIZED_NAME_TITLE_SENTIMENT_MIN) private Double titleSentimentMin; public static final String SERIALIZED_NAME_TITLE_SENTIMENT_MAX = "title_sentiment_max"; @SerializedName(SERIALIZED_NAME_TITLE_SENTIMENT_MAX) private Double titleSentimentMax; public static final String SERIALIZED_NAME_CONTENT_SENTIMENT_MIN = "content_sentiment_min"; @SerializedName(SERIALIZED_NAME_CONTENT_SENTIMENT_MIN) private Double contentSentimentMin; public static final String SERIALIZED_NAME_CONTENT_SENTIMENT_MAX = "content_sentiment_max"; @SerializedName(SERIALIZED_NAME_CONTENT_SENTIMENT_MAX) private Double contentSentimentMax; public static final String SERIALIZED_NAME_IPTC_TAGS = "iptc_tags"; @SerializedName(SERIALIZED_NAME_IPTC_TAGS) private Object iptcTags = null; public static final String SERIALIZED_NAME_NOT_IPTC_TAGS = "not_iptc_tags"; @SerializedName(SERIALIZED_NAME_NOT_IPTC_TAGS) private Object notIptcTags = null; public MoreLikeThisRequest() { } public MoreLikeThisRequest q(String q) { this.q = q; return this; } /** * Get q * @return q **/ @javax.annotation.Nonnull @ApiModelProperty(required = true, value = "") public String getQ() { return q; } public void setQ(String q) { this.q = q; } public MoreLikeThisRequest searchIn(String searchIn) { this.searchIn = searchIn; return this; } /** * Get searchIn * @return searchIn **/ @javax.annotation.Nullable @ApiModelProperty(example = "title_content", value = "") public String getSearchIn() { return searchIn; } public void setSearchIn(String searchIn) { this.searchIn = searchIn; } public MoreLikeThisRequest includeSimilarDocuments(Boolean includeSimilarDocuments) { this.includeSimilarDocuments = includeSimilarDocuments; return this; } /** * Get includeSimilarDocuments * @return includeSimilarDocuments **/ @javax.annotation.Nullable @ApiModelProperty(example = "false", value = "") public Boolean getIncludeSimilarDocuments() { return includeSimilarDocuments; } public void setIncludeSimilarDocuments(Boolean includeSimilarDocuments) { this.includeSimilarDocuments = includeSimilarDocuments; } public MoreLikeThisRequest similarDocumentsNumber(Integer similarDocumentsNumber) { if (similarDocumentsNumber != null && similarDocumentsNumber < 0) { throw new IllegalArgumentException("Invalid value for similarDocumentsNumber. Must be greater than or equal to 0."); } this.similarDocumentsNumber = similarDocumentsNumber; return this; } /** * Get similarDocumentsNumber * minimum: 0 * @return similarDocumentsNumber **/ @javax.annotation.Nullable @ApiModelProperty(example = "5", value = "") public Integer getSimilarDocumentsNumber() { return similarDocumentsNumber; } public void setSimilarDocumentsNumber(Integer similarDocumentsNumber) { if (similarDocumentsNumber != null && similarDocumentsNumber < 0) { throw new IllegalArgumentException("Invalid value for similarDocumentsNumber. Must be greater than or equal to 0."); } this.similarDocumentsNumber = similarDocumentsNumber; } public MoreLikeThisRequest similarDocumentsFields(String similarDocumentsFields) { this.similarDocumentsFields = similarDocumentsFields; return this; } /** * Get similarDocumentsFields * @return similarDocumentsFields **/ @javax.annotation.Nullable @ApiModelProperty(example = "title,content", value = "") public String getSimilarDocumentsFields() { return similarDocumentsFields; } public void setSimilarDocumentsFields(String similarDocumentsFields) { this.similarDocumentsFields = similarDocumentsFields; } public MoreLikeThisRequest predefinedSources(Object predefinedSources) { this.predefinedSources = predefinedSources; return this; } /** * Get predefinedSources * @return predefinedSources **/ @javax.annotation.Nullable @ApiModelProperty(value = "") public Object getPredefinedSources() { return predefinedSources; } public void setPredefinedSources(Object predefinedSources) { this.predefinedSources = predefinedSources; } public MoreLikeThisRequest sources(Object sources) { this.sources = sources; return this; } /** * Get sources * @return sources **/ @javax.annotation.Nullable @ApiModelProperty(value = "") public Object getSources() { return sources; } public void setSources(Object sources) { this.sources = sources; } public MoreLikeThisRequest notSources(Object notSources) { this.notSources = notSources; return this; } /** * Get notSources * @return notSources **/ @javax.annotation.Nullable @ApiModelProperty(value = "") public Object getNotSources() { return notSources; } public void setNotSources(Object notSources) { this.notSources = notSources; } public MoreLikeThisRequest lang(Object lang) { this.lang = lang; return this; } /** * Get lang * @return lang **/ @javax.annotation.Nullable @ApiModelProperty(value = "") public Object getLang() { return lang; } public void setLang(Object lang) { this.lang = lang; } public MoreLikeThisRequest notLang(Object notLang) { this.notLang = notLang; return this; } /** * Get notLang * @return notLang **/ @javax.annotation.Nullable @ApiModelProperty(value = "") public Object getNotLang() { return notLang; } public void setNotLang(Object notLang) { this.notLang = notLang; } public MoreLikeThisRequest countries(Object countries) { this.countries = countries; return this; } /** * Get countries * @return countries **/ @javax.annotation.Nullable @ApiModelProperty(value = "") public Object getCountries() { return countries; } public void setCountries(Object countries) { this.countries = countries; } public MoreLikeThisRequest notCountries(Object notCountries) { this.notCountries = notCountries; return this; } /** * Get notCountries * @return notCountries **/ @javax.annotation.Nullable @ApiModelProperty(value = "") public Object getNotCountries() { return notCountries; } public void setNotCountries(Object notCountries) { this.notCountries = notCountries; } public MoreLikeThisRequest from(String from) { this.from = from; return this; } /** * Get from * @return from **/ @javax.annotation.Nullable @ApiModelProperty(value = "") public String getFrom() { return from; } public void setFrom(String from) { this.from = from; } public MoreLikeThisRequest to(String to) { this.to = to; return this; } /** * Get to * @return to **/ @javax.annotation.Nullable @ApiModelProperty(value = "") public String getTo() { return to; } public void setTo(String to) { this.to = to; } public MoreLikeThisRequest byParseDate(Boolean byParseDate) { this.byParseDate = byParseDate; return this; } /** * Get byParseDate * @return byParseDate **/ @javax.annotation.Nullable @ApiModelProperty(example = "false", value = "") public Boolean getByParseDate() { return byParseDate; } public void setByParseDate(Boolean byParseDate) { this.byParseDate = byParseDate; } public MoreLikeThisRequest publishedDatePrecision(String publishedDatePrecision) { this.publishedDatePrecision = publishedDatePrecision; return this; } /** * Get publishedDatePrecision * @return publishedDatePrecision **/ @javax.annotation.Nullable @ApiModelProperty(value = "") public String getPublishedDatePrecision() { return publishedDatePrecision; } public void setPublishedDatePrecision(String publishedDatePrecision) { this.publishedDatePrecision = publishedDatePrecision; } public MoreLikeThisRequest sortBy(String sortBy) { this.sortBy = sortBy; return this; } /** * Get sortBy * @return sortBy **/ @javax.annotation.Nullable @ApiModelProperty(example = "relevancy", value = "") public String getSortBy() { return sortBy; } public void setSortBy(String sortBy) { this.sortBy = sortBy; } public MoreLikeThisRequest rankedOnly(Object rankedOnly) { this.rankedOnly = rankedOnly; return this; } /** * Get rankedOnly * @return rankedOnly **/ @javax.annotation.Nullable @ApiModelProperty(value = "") public Object getRankedOnly() { return rankedOnly; } public void setRankedOnly(Object rankedOnly) { this.rankedOnly = rankedOnly; } public MoreLikeThisRequest fromRank(Integer fromRank) { this.fromRank = fromRank; return this; } /** * Get fromRank * @return fromRank **/ @javax.annotation.Nullable @ApiModelProperty(value = "") public Integer getFromRank() { return fromRank; } public void setFromRank(Integer fromRank) { this.fromRank = fromRank; } public MoreLikeThisRequest toRank(Integer toRank) { this.toRank = toRank; return this; } /** * Get toRank * @return toRank **/ @javax.annotation.Nullable @ApiModelProperty(value = "") public Integer getToRank() { return toRank; } public void setToRank(Integer toRank) { this.toRank = toRank; } public MoreLikeThisRequest isHeadline(Boolean isHeadline) { this.isHeadline = isHeadline; return this; } /** * Get isHeadline * @return isHeadline **/ @javax.annotation.Nullable @ApiModelProperty(value = "") public Boolean getIsHeadline() { return isHeadline; } public void setIsHeadline(Boolean isHeadline) { this.isHeadline = isHeadline; } public MoreLikeThisRequest isOpinion(Boolean isOpinion) { this.isOpinion = isOpinion; return this; } /** * Get isOpinion * @return isOpinion **/ @javax.annotation.Nullable @ApiModelProperty(value = "") public Boolean getIsOpinion() { return isOpinion; } public void setIsOpinion(Boolean isOpinion) { this.isOpinion = isOpinion; } public MoreLikeThisRequest isPaidContent(Boolean isPaidContent) { this.isPaidContent = isPaidContent; return this; } /** * Get isPaidContent * @return isPaidContent **/ @javax.annotation.Nullable @ApiModelProperty(value = "") public Boolean getIsPaidContent() { return isPaidContent; } public void setIsPaidContent(Boolean isPaidContent) { this.isPaidContent = isPaidContent; } public MoreLikeThisRequest parentUrl(Object parentUrl) { this.parentUrl = parentUrl; return this; } /** * Get parentUrl * @return parentUrl **/ @javax.annotation.Nullable @ApiModelProperty(value = "") public Object getParentUrl() { return parentUrl; } public void setParentUrl(Object parentUrl) { this.parentUrl = parentUrl; } public MoreLikeThisRequest allLinks(Object allLinks) { this.allLinks = allLinks; return this; } /** * Get allLinks * @return allLinks **/ @javax.annotation.Nullable @ApiModelProperty(value = "") public Object getAllLinks() { return allLinks; } public void setAllLinks(Object allLinks) { this.allLinks = allLinks; } public MoreLikeThisRequest allDomainLinks(Object allDomainLinks) { this.allDomainLinks = allDomainLinks; return this; } /** * Get allDomainLinks * @return allDomainLinks **/ @javax.annotation.Nullable @ApiModelProperty(value = "") public Object getAllDomainLinks() { return allDomainLinks; } public void setAllDomainLinks(Object allDomainLinks) { this.allDomainLinks = allDomainLinks; } public MoreLikeThisRequest wordCountMin(Integer wordCountMin) { if (wordCountMin != null && wordCountMin < 0) { throw new IllegalArgumentException("Invalid value for wordCountMin. Must be greater than or equal to 0."); } this.wordCountMin = wordCountMin; return this; } /** * Get wordCountMin * minimum: 0 * @return wordCountMin **/ @javax.annotation.Nullable @ApiModelProperty(value = "") public Integer getWordCountMin() { return wordCountMin; } public void setWordCountMin(Integer wordCountMin) { if (wordCountMin != null && wordCountMin < 0) { throw new IllegalArgumentException("Invalid value for wordCountMin. Must be greater than or equal to 0."); } this.wordCountMin = wordCountMin; } public MoreLikeThisRequest wordCountMax(Integer wordCountMax) { if (wordCountMax != null && wordCountMax < 0) { throw new IllegalArgumentException("Invalid value for wordCountMax. Must be greater than or equal to 0."); } this.wordCountMax = wordCountMax; return this; } /** * Get wordCountMax * minimum: 0 * @return wordCountMax **/ @javax.annotation.Nullable @ApiModelProperty(value = "") public Integer getWordCountMax() { return wordCountMax; } public void setWordCountMax(Integer wordCountMax) { if (wordCountMax != null && wordCountMax < 0) { throw new IllegalArgumentException("Invalid value for wordCountMax. Must be greater than or equal to 0."); } this.wordCountMax = wordCountMax; } public MoreLikeThisRequest page(Integer page) { if (page != null && page < 0) { throw new IllegalArgumentException("Invalid value for page. Must be greater than or equal to 0."); } this.page = page; return this; } /** * Get page * minimum: 0 * @return page **/ @javax.annotation.Nullable @ApiModelProperty(example = "1", value = "") public Integer getPage() { return page; } public void setPage(Integer page) { if (page != null && page < 0) { throw new IllegalArgumentException("Invalid value for page. Must be greater than or equal to 0."); } this.page = page; } public MoreLikeThisRequest pageSize(Integer pageSize) { if (pageSize != null && pageSize < 0) { throw new IllegalArgumentException("Invalid value for pageSize. Must be greater than or equal to 0."); } this.pageSize = pageSize; return this; } /** * Get pageSize * minimum: 0 * @return pageSize **/ @javax.annotation.Nullable @ApiModelProperty(example = "100", value = "") public Integer getPageSize() { return pageSize; } public void setPageSize(Integer pageSize) { if (pageSize != null && pageSize < 0) { throw new IllegalArgumentException("Invalid value for pageSize. Must be greater than or equal to 0."); } this.pageSize = pageSize; } public MoreLikeThisRequest includeNlpData(Boolean includeNlpData) { this.includeNlpData = includeNlpData; return this; } /** * Get includeNlpData * @return includeNlpData **/ @javax.annotation.Nullable @ApiModelProperty(value = "") public Boolean getIncludeNlpData() { return includeNlpData; } public void setIncludeNlpData(Boolean includeNlpData) { this.includeNlpData = includeNlpData; } public MoreLikeThisRequest hasNlp(Boolean hasNlp) { this.hasNlp = hasNlp; return this; } /** * Get hasNlp * @return hasNlp **/ @javax.annotation.Nullable @ApiModelProperty(value = "") public Boolean getHasNlp() { return hasNlp; } public void setHasNlp(Boolean hasNlp) { this.hasNlp = hasNlp; } public MoreLikeThisRequest theme(String theme) { this.theme = theme; return this; } /** * Get theme * @return theme **/ @javax.annotation.Nullable @ApiModelProperty(value = "") public String getTheme() { return theme; } public void setTheme(String theme) { this.theme = theme; } public MoreLikeThisRequest notTheme(String notTheme) { this.notTheme = notTheme; return this; } /** * Get notTheme * @return notTheme **/ @javax.annotation.Nullable @ApiModelProperty(value = "") public String getNotTheme() { return notTheme; } public void setNotTheme(String notTheme) { this.notTheme = notTheme; } public MoreLikeThisRequest titleSentimentMin(Double titleSentimentMin) { this.titleSentimentMin = titleSentimentMin; return this; } public MoreLikeThisRequest titleSentimentMin(Integer titleSentimentMin) { this.titleSentimentMin = titleSentimentMin.doubleValue(); return this; } /** * Get titleSentimentMin * @return titleSentimentMin **/ @javax.annotation.Nullable @ApiModelProperty(value = "") public Double getTitleSentimentMin() { return titleSentimentMin; } public void setTitleSentimentMin(Double titleSentimentMin) { this.titleSentimentMin = titleSentimentMin; } public MoreLikeThisRequest titleSentimentMax(Double titleSentimentMax) { this.titleSentimentMax = titleSentimentMax; return this; } public MoreLikeThisRequest titleSentimentMax(Integer titleSentimentMax) { this.titleSentimentMax = titleSentimentMax.doubleValue(); return this; } /** * Get titleSentimentMax * @return titleSentimentMax **/ @javax.annotation.Nullable @ApiModelProperty(value = "") public Double getTitleSentimentMax() { return titleSentimentMax; } public void setTitleSentimentMax(Double titleSentimentMax) { this.titleSentimentMax = titleSentimentMax; } public MoreLikeThisRequest contentSentimentMin(Double contentSentimentMin) { this.contentSentimentMin = contentSentimentMin; return this; } public MoreLikeThisRequest contentSentimentMin(Integer contentSentimentMin) { this.contentSentimentMin = contentSentimentMin.doubleValue(); return this; } /** * Get contentSentimentMin * @return contentSentimentMin **/ @javax.annotation.Nullable @ApiModelProperty(value = "") public Double getContentSentimentMin() { return contentSentimentMin; } public void setContentSentimentMin(Double contentSentimentMin) { this.contentSentimentMin = contentSentimentMin; } public MoreLikeThisRequest contentSentimentMax(Double contentSentimentMax) { this.contentSentimentMax = contentSentimentMax; return this; } public MoreLikeThisRequest contentSentimentMax(Integer contentSentimentMax) { this.contentSentimentMax = contentSentimentMax.doubleValue(); return this; } /** * Get contentSentimentMax * @return contentSentimentMax **/ @javax.annotation.Nullable @ApiModelProperty(value = "") public Double getContentSentimentMax() { return contentSentimentMax; } public void setContentSentimentMax(Double contentSentimentMax) { this.contentSentimentMax = contentSentimentMax; } public MoreLikeThisRequest iptcTags(Object iptcTags) { this.iptcTags = iptcTags; return this; } /** * Get iptcTags * @return iptcTags **/ @javax.annotation.Nullable @ApiModelProperty(value = "") public Object getIptcTags() { return iptcTags; } public void setIptcTags(Object iptcTags) { this.iptcTags = iptcTags; } public MoreLikeThisRequest notIptcTags(Object notIptcTags) { this.notIptcTags = notIptcTags; return this; } /** * Get notIptcTags * @return notIptcTags **/ @javax.annotation.Nullable @ApiModelProperty(value = "") public Object getNotIptcTags() { return notIptcTags; } public void setNotIptcTags(Object notIptcTags) { this.notIptcTags = notIptcTags; } /** * A container for additional, undeclared properties. * This is a holder for any undeclared properties as specified with * the 'additionalProperties' keyword in the OAS document. */ private Map additionalProperties; /** * Set the additional (undeclared) property with the specified name and value. * If the property does not already exist, create it otherwise replace it. * * @param key name of the property * @param value value of the property * @return the MoreLikeThisRequest instance itself */ public MoreLikeThisRequest putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { this.additionalProperties = new HashMap(); } this.additionalProperties.put(key, value); return this; } /** * Return the additional (undeclared) property. * * @return a map of objects */ public Map getAdditionalProperties() { return additionalProperties; } /** * Return the additional (undeclared) property with the specified name. * * @param key name of the property * @return an object */ public Object getAdditionalProperty(String key) { if (this.additionalProperties == null) { return null; } return this.additionalProperties.get(key); } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } MoreLikeThisRequest moreLikeThisRequest = (MoreLikeThisRequest) o; return Objects.equals(this.q, moreLikeThisRequest.q) && Objects.equals(this.searchIn, moreLikeThisRequest.searchIn) && Objects.equals(this.includeSimilarDocuments, moreLikeThisRequest.includeSimilarDocuments) && Objects.equals(this.similarDocumentsNumber, moreLikeThisRequest.similarDocumentsNumber) && Objects.equals(this.similarDocumentsFields, moreLikeThisRequest.similarDocumentsFields) && Objects.equals(this.predefinedSources, moreLikeThisRequest.predefinedSources) && Objects.equals(this.sources, moreLikeThisRequest.sources) && Objects.equals(this.notSources, moreLikeThisRequest.notSources) && Objects.equals(this.lang, moreLikeThisRequest.lang) && Objects.equals(this.notLang, moreLikeThisRequest.notLang) && Objects.equals(this.countries, moreLikeThisRequest.countries) && Objects.equals(this.notCountries, moreLikeThisRequest.notCountries) && Objects.equals(this.from, moreLikeThisRequest.from) && Objects.equals(this.to, moreLikeThisRequest.to) && Objects.equals(this.byParseDate, moreLikeThisRequest.byParseDate) && Objects.equals(this.publishedDatePrecision, moreLikeThisRequest.publishedDatePrecision) && Objects.equals(this.sortBy, moreLikeThisRequest.sortBy) && Objects.equals(this.rankedOnly, moreLikeThisRequest.rankedOnly) && Objects.equals(this.fromRank, moreLikeThisRequest.fromRank) && Objects.equals(this.toRank, moreLikeThisRequest.toRank) && Objects.equals(this.isHeadline, moreLikeThisRequest.isHeadline) && Objects.equals(this.isOpinion, moreLikeThisRequest.isOpinion) && Objects.equals(this.isPaidContent, moreLikeThisRequest.isPaidContent) && Objects.equals(this.parentUrl, moreLikeThisRequest.parentUrl) && Objects.equals(this.allLinks, moreLikeThisRequest.allLinks) && Objects.equals(this.allDomainLinks, moreLikeThisRequest.allDomainLinks) && Objects.equals(this.wordCountMin, moreLikeThisRequest.wordCountMin) && Objects.equals(this.wordCountMax, moreLikeThisRequest.wordCountMax) && Objects.equals(this.page, moreLikeThisRequest.page) && Objects.equals(this.pageSize, moreLikeThisRequest.pageSize) && Objects.equals(this.includeNlpData, moreLikeThisRequest.includeNlpData) && Objects.equals(this.hasNlp, moreLikeThisRequest.hasNlp) && Objects.equals(this.theme, moreLikeThisRequest.theme) && Objects.equals(this.notTheme, moreLikeThisRequest.notTheme) && Objects.equals(this.titleSentimentMin, moreLikeThisRequest.titleSentimentMin) && Objects.equals(this.titleSentimentMax, moreLikeThisRequest.titleSentimentMax) && Objects.equals(this.contentSentimentMin, moreLikeThisRequest.contentSentimentMin) && Objects.equals(this.contentSentimentMax, moreLikeThisRequest.contentSentimentMax) && Objects.equals(this.iptcTags, moreLikeThisRequest.iptcTags) && Objects.equals(this.notIptcTags, moreLikeThisRequest.notIptcTags)&& Objects.equals(this.additionalProperties, moreLikeThisRequest.additionalProperties); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); } @Override public int hashCode() { return Objects.hash(q, searchIn, includeSimilarDocuments, similarDocumentsNumber, similarDocumentsFields, predefinedSources, sources, notSources, lang, notLang, countries, notCountries, from, to, byParseDate, publishedDatePrecision, sortBy, rankedOnly, fromRank, toRank, isHeadline, isOpinion, isPaidContent, parentUrl, allLinks, allDomainLinks, wordCountMin, wordCountMax, page, pageSize, includeNlpData, hasNlp, theme, notTheme, titleSentimentMin, titleSentimentMax, contentSentimentMin, contentSentimentMax, iptcTags, notIptcTags, additionalProperties); } private static int hashCodeNullable(JsonNullable a) { if (a == null) { return 1; } return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class MoreLikeThisRequest {\n"); sb.append(" q: ").append(toIndentedString(q)).append("\n"); sb.append(" searchIn: ").append(toIndentedString(searchIn)).append("\n"); sb.append(" includeSimilarDocuments: ").append(toIndentedString(includeSimilarDocuments)).append("\n"); sb.append(" similarDocumentsNumber: ").append(toIndentedString(similarDocumentsNumber)).append("\n"); sb.append(" similarDocumentsFields: ").append(toIndentedString(similarDocumentsFields)).append("\n"); sb.append(" predefinedSources: ").append(toIndentedString(predefinedSources)).append("\n"); sb.append(" sources: ").append(toIndentedString(sources)).append("\n"); sb.append(" notSources: ").append(toIndentedString(notSources)).append("\n"); sb.append(" lang: ").append(toIndentedString(lang)).append("\n"); sb.append(" notLang: ").append(toIndentedString(notLang)).append("\n"); sb.append(" countries: ").append(toIndentedString(countries)).append("\n"); sb.append(" notCountries: ").append(toIndentedString(notCountries)).append("\n"); sb.append(" from: ").append(toIndentedString(from)).append("\n"); sb.append(" to: ").append(toIndentedString(to)).append("\n"); sb.append(" byParseDate: ").append(toIndentedString(byParseDate)).append("\n"); sb.append(" publishedDatePrecision: ").append(toIndentedString(publishedDatePrecision)).append("\n"); sb.append(" sortBy: ").append(toIndentedString(sortBy)).append("\n"); sb.append(" rankedOnly: ").append(toIndentedString(rankedOnly)).append("\n"); sb.append(" fromRank: ").append(toIndentedString(fromRank)).append("\n"); sb.append(" toRank: ").append(toIndentedString(toRank)).append("\n"); sb.append(" isHeadline: ").append(toIndentedString(isHeadline)).append("\n"); sb.append(" isOpinion: ").append(toIndentedString(isOpinion)).append("\n"); sb.append(" isPaidContent: ").append(toIndentedString(isPaidContent)).append("\n"); sb.append(" parentUrl: ").append(toIndentedString(parentUrl)).append("\n"); sb.append(" allLinks: ").append(toIndentedString(allLinks)).append("\n"); sb.append(" allDomainLinks: ").append(toIndentedString(allDomainLinks)).append("\n"); sb.append(" wordCountMin: ").append(toIndentedString(wordCountMin)).append("\n"); sb.append(" wordCountMax: ").append(toIndentedString(wordCountMax)).append("\n"); sb.append(" page: ").append(toIndentedString(page)).append("\n"); sb.append(" pageSize: ").append(toIndentedString(pageSize)).append("\n"); sb.append(" includeNlpData: ").append(toIndentedString(includeNlpData)).append("\n"); sb.append(" hasNlp: ").append(toIndentedString(hasNlp)).append("\n"); sb.append(" theme: ").append(toIndentedString(theme)).append("\n"); sb.append(" notTheme: ").append(toIndentedString(notTheme)).append("\n"); sb.append(" titleSentimentMin: ").append(toIndentedString(titleSentimentMin)).append("\n"); sb.append(" titleSentimentMax: ").append(toIndentedString(titleSentimentMax)).append("\n"); sb.append(" contentSentimentMin: ").append(toIndentedString(contentSentimentMin)).append("\n"); sb.append(" contentSentimentMax: ").append(toIndentedString(contentSentimentMax)).append("\n"); sb.append(" iptcTags: ").append(toIndentedString(iptcTags)).append("\n"); sb.append(" notIptcTags: ").append(toIndentedString(notIptcTags)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } /** * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ private String toIndentedString(Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } public static HashSet openapiFields; public static HashSet openapiRequiredFields; static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); openapiFields.add("q"); openapiFields.add("search_in"); openapiFields.add("include_similar_documents"); openapiFields.add("similar_documents_number"); openapiFields.add("similar_documents_fields"); openapiFields.add("predefined_sources"); openapiFields.add("sources"); openapiFields.add("not_sources"); openapiFields.add("lang"); openapiFields.add("not_lang"); openapiFields.add("countries"); openapiFields.add("not_countries"); openapiFields.add("from_"); openapiFields.add("to_"); openapiFields.add("by_parse_date"); openapiFields.add("published_date_precision"); openapiFields.add("sort_by"); openapiFields.add("ranked_only"); openapiFields.add("from_rank"); openapiFields.add("to_rank"); openapiFields.add("is_headline"); openapiFields.add("is_opinion"); openapiFields.add("is_paid_content"); openapiFields.add("parent_url"); openapiFields.add("all_links"); openapiFields.add("all_domain_links"); openapiFields.add("word_count_min"); openapiFields.add("word_count_max"); openapiFields.add("page"); openapiFields.add("page_size"); openapiFields.add("include_nlp_data"); openapiFields.add("has_nlp"); openapiFields.add("theme"); openapiFields.add("not_theme"); openapiFields.add("title_sentiment_min"); openapiFields.add("title_sentiment_max"); openapiFields.add("content_sentiment_min"); openapiFields.add("content_sentiment_max"); openapiFields.add("iptc_tags"); openapiFields.add("not_iptc_tags"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); openapiRequiredFields.add("q"); } /** * Validates the JSON Object and throws an exception if issues found * * @param jsonObj JSON Object * @throws IOException if the JSON Object is invalid with respect to MoreLikeThisRequest */ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if (jsonObj == null) { if (!MoreLikeThisRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null throw new IllegalArgumentException(String.format("The required field(s) %s in MoreLikeThisRequest is not found in the empty JSON string", MoreLikeThisRequest.openapiRequiredFields.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : MoreLikeThisRequest.openapiRequiredFields) { if (jsonObj.get(requiredField) == null) { throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); } } if (!jsonObj.get("q").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `q` to be a primitive type in the JSON string but got `%s`", jsonObj.get("q").toString())); } if ((jsonObj.get("search_in") != null && !jsonObj.get("search_in").isJsonNull()) && !jsonObj.get("search_in").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `search_in` to be a primitive type in the JSON string but got `%s`", jsonObj.get("search_in").toString())); } if ((jsonObj.get("similar_documents_fields") != null && !jsonObj.get("similar_documents_fields").isJsonNull()) && !jsonObj.get("similar_documents_fields").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `similar_documents_fields` to be a primitive type in the JSON string but got `%s`", jsonObj.get("similar_documents_fields").toString())); } if ((jsonObj.get("from_") != null && !jsonObj.get("from_").isJsonNull()) && !jsonObj.get("from_").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `from_` to be a primitive type in the JSON string but got `%s`", jsonObj.get("from_").toString())); } if ((jsonObj.get("to_") != null && !jsonObj.get("to_").isJsonNull()) && !jsonObj.get("to_").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `to_` to be a primitive type in the JSON string but got `%s`", jsonObj.get("to_").toString())); } if ((jsonObj.get("published_date_precision") != null && !jsonObj.get("published_date_precision").isJsonNull()) && !jsonObj.get("published_date_precision").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `published_date_precision` to be a primitive type in the JSON string but got `%s`", jsonObj.get("published_date_precision").toString())); } if ((jsonObj.get("sort_by") != null && !jsonObj.get("sort_by").isJsonNull()) && !jsonObj.get("sort_by").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `sort_by` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sort_by").toString())); } if ((jsonObj.get("theme") != null && !jsonObj.get("theme").isJsonNull()) && !jsonObj.get("theme").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `theme` to be a primitive type in the JSON string but got `%s`", jsonObj.get("theme").toString())); } if ((jsonObj.get("not_theme") != null && !jsonObj.get("not_theme").isJsonNull()) && !jsonObj.get("not_theme").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `not_theme` to be a primitive type in the JSON string but got `%s`", jsonObj.get("not_theme").toString())); } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { if (!MoreLikeThisRequest.class.isAssignableFrom(type.getRawType())) { return null; // this class only serializes 'MoreLikeThisRequest' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); final TypeAdapter thisAdapter = gson.getDelegateAdapter(this, TypeToken.get(MoreLikeThisRequest.class)); return (TypeAdapter) new TypeAdapter() { @Override public void write(JsonWriter out, MoreLikeThisRequest value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); obj.remove("additionalProperties"); // serialize additonal properties if (value.getAdditionalProperties() != null) { for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { if (entry.getValue() instanceof String) obj.addProperty(entry.getKey(), (String) entry.getValue()); else if (entry.getValue() instanceof Number) obj.addProperty(entry.getKey(), (Number) entry.getValue()); else if (entry.getValue() instanceof Boolean) obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else if (entry.getValue() == null) { obj.addProperty(entry.getKey(), (String) null); } else { obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); } } } elementAdapter.write(out, obj); } @Override public MoreLikeThisRequest read(JsonReader in) throws IOException { JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); validateJsonObject(jsonObj); // store additional fields in the deserialized instance MoreLikeThisRequest instance = thisAdapter.fromJsonTree(jsonObj); for (Map.Entry entry : jsonObj.entrySet()) { if (!openapiFields.contains(entry.getKey())) { if (entry.getValue().isJsonPrimitive()) { // primitive type if (entry.getValue().getAsJsonPrimitive().isString()) instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); else if (entry.getValue().getAsJsonPrimitive().isNumber()) instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); else if (entry.getValue().getAsJsonPrimitive().isBoolean()) instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); else throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); } else if (entry.getValue().isJsonArray()) { instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); } else { // JSON object instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); } } } return instance; } }.nullSafe(); } } /** * Create an instance of MoreLikeThisRequest given an JSON string * * @param jsonString JSON string * @return An instance of MoreLikeThisRequest * @throws IOException if the JSON string is invalid with respect to MoreLikeThisRequest */ public static MoreLikeThisRequest fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, MoreLikeThisRequest.class); } /** * Convert an instance of MoreLikeThisRequest to an JSON string * * @return JSON string */ public String toJson() { return JSON.getGson().toJson(this); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy