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

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

/*
 * 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; /** * Author search request DTO. */ @ApiModel(description = "Author search request DTO.")@javax.annotation.Generated(value = "Generated by https://konfigthis.com") public class AuthorSearchRequest { public static final String SERIALIZED_NAME_AUTHOR_NAME = "author_name"; @SerializedName(SERIALIZED_NAME_AUTHOR_NAME) private String authorName; public static final String SERIALIZED_NAME_NOT_AUTHOR_NAME = "not_author_name"; @SerializedName(SERIALIZED_NAME_NOT_AUTHOR_NAME) private String notAuthorName; public static final String SERIALIZED_NAME_SOURCES = "sources"; @SerializedName(SERIALIZED_NAME_SOURCES) private Object sources = null; 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_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_PUBLISHED_DATE_PRECISION = "published_date_precision"; @SerializedName(SERIALIZED_NAME_PUBLISHED_DATE_PRECISION) private String publishedDatePrecision; 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_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 String rankedOnly; 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_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_NER_NAME = "ner_name"; @SerializedName(SERIALIZED_NAME_NER_NAME) private String nerName; 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 static final String SERIALIZED_NAME_IAB_TAGS = "iab_tags"; @SerializedName(SERIALIZED_NAME_IAB_TAGS) private Object iabTags = null; public static final String SERIALIZED_NAME_NOT_IAB_TAGS = "not_iab_tags"; @SerializedName(SERIALIZED_NAME_NOT_IAB_TAGS) private Object notIabTags = null; public AuthorSearchRequest() { } public AuthorSearchRequest authorName(String authorName) { this.authorName = authorName; return this; } /** * Get authorName * @return authorName **/ @javax.annotation.Nonnull @ApiModelProperty(required = true, value = "") public String getAuthorName() { return authorName; } public void setAuthorName(String authorName) { this.authorName = authorName; } public AuthorSearchRequest notAuthorName(String notAuthorName) { this.notAuthorName = notAuthorName; return this; } /** * Get notAuthorName * @return notAuthorName **/ @javax.annotation.Nullable @ApiModelProperty(value = "") public String getNotAuthorName() { return notAuthorName; } public void setNotAuthorName(String notAuthorName) { this.notAuthorName = notAuthorName; } public AuthorSearchRequest 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 AuthorSearchRequest 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 AuthorSearchRequest 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 AuthorSearchRequest 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 AuthorSearchRequest 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 AuthorSearchRequest 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 AuthorSearchRequest 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 AuthorSearchRequest 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 AuthorSearchRequest 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 AuthorSearchRequest 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 AuthorSearchRequest 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 AuthorSearchRequest 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 AuthorSearchRequest rankedOnly(String rankedOnly) { this.rankedOnly = rankedOnly; return this; } /** * Get rankedOnly * @return rankedOnly **/ @javax.annotation.Nullable @ApiModelProperty(value = "") public String getRankedOnly() { return rankedOnly; } public void setRankedOnly(String rankedOnly) { this.rankedOnly = rankedOnly; } public AuthorSearchRequest 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 AuthorSearchRequest 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 AuthorSearchRequest 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 AuthorSearchRequest 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 AuthorSearchRequest 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 AuthorSearchRequest 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 AuthorSearchRequest 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 AuthorSearchRequest 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 AuthorSearchRequest 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 AuthorSearchRequest 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 AuthorSearchRequest 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 AuthorSearchRequest 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 AuthorSearchRequest 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 AuthorSearchRequest 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 AuthorSearchRequest 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 AuthorSearchRequest nerName(String nerName) { this.nerName = nerName; return this; } /** * Get nerName * @return nerName **/ @javax.annotation.Nullable @ApiModelProperty(value = "") public String getNerName() { return nerName; } public void setNerName(String nerName) { this.nerName = nerName; } public AuthorSearchRequest titleSentimentMin(Double titleSentimentMin) { this.titleSentimentMin = titleSentimentMin; return this; } public AuthorSearchRequest 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 AuthorSearchRequest titleSentimentMax(Double titleSentimentMax) { this.titleSentimentMax = titleSentimentMax; return this; } public AuthorSearchRequest 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 AuthorSearchRequest contentSentimentMin(Double contentSentimentMin) { this.contentSentimentMin = contentSentimentMin; return this; } public AuthorSearchRequest 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 AuthorSearchRequest contentSentimentMax(Double contentSentimentMax) { this.contentSentimentMax = contentSentimentMax; return this; } public AuthorSearchRequest 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 AuthorSearchRequest 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 AuthorSearchRequest 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; } public AuthorSearchRequest iabTags(Object iabTags) { this.iabTags = iabTags; return this; } /** * Get iabTags * @return iabTags **/ @javax.annotation.Nullable @ApiModelProperty(value = "") public Object getIabTags() { return iabTags; } public void setIabTags(Object iabTags) { this.iabTags = iabTags; } public AuthorSearchRequest notIabTags(Object notIabTags) { this.notIabTags = notIabTags; return this; } /** * Get notIabTags * @return notIabTags **/ @javax.annotation.Nullable @ApiModelProperty(value = "") public Object getNotIabTags() { return notIabTags; } public void setNotIabTags(Object notIabTags) { this.notIabTags = notIabTags; } /** * 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 AuthorSearchRequest instance itself */ public AuthorSearchRequest 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; } AuthorSearchRequest authorSearchRequest = (AuthorSearchRequest) o; return Objects.equals(this.authorName, authorSearchRequest.authorName) && Objects.equals(this.notAuthorName, authorSearchRequest.notAuthorName) && Objects.equals(this.sources, authorSearchRequest.sources) && Objects.equals(this.predefinedSources, authorSearchRequest.predefinedSources) && Objects.equals(this.notSources, authorSearchRequest.notSources) && Objects.equals(this.lang, authorSearchRequest.lang) && Objects.equals(this.notLang, authorSearchRequest.notLang) && Objects.equals(this.countries, authorSearchRequest.countries) && Objects.equals(this.notCountries, authorSearchRequest.notCountries) && Objects.equals(this.from, authorSearchRequest.from) && Objects.equals(this.to, authorSearchRequest.to) && Objects.equals(this.publishedDatePrecision, authorSearchRequest.publishedDatePrecision) && Objects.equals(this.byParseDate, authorSearchRequest.byParseDate) && Objects.equals(this.sortBy, authorSearchRequest.sortBy) && Objects.equals(this.rankedOnly, authorSearchRequest.rankedOnly) && Objects.equals(this.fromRank, authorSearchRequest.fromRank) && Objects.equals(this.toRank, authorSearchRequest.toRank) && Objects.equals(this.isHeadline, authorSearchRequest.isHeadline) && Objects.equals(this.isPaidContent, authorSearchRequest.isPaidContent) && Objects.equals(this.parentUrl, authorSearchRequest.parentUrl) && Objects.equals(this.allLinks, authorSearchRequest.allLinks) && Objects.equals(this.allDomainLinks, authorSearchRequest.allDomainLinks) && Objects.equals(this.wordCountMin, authorSearchRequest.wordCountMin) && Objects.equals(this.wordCountMax, authorSearchRequest.wordCountMax) && Objects.equals(this.page, authorSearchRequest.page) && Objects.equals(this.pageSize, authorSearchRequest.pageSize) && Objects.equals(this.includeNlpData, authorSearchRequest.includeNlpData) && Objects.equals(this.hasNlp, authorSearchRequest.hasNlp) && Objects.equals(this.theme, authorSearchRequest.theme) && Objects.equals(this.notTheme, authorSearchRequest.notTheme) && Objects.equals(this.nerName, authorSearchRequest.nerName) && Objects.equals(this.titleSentimentMin, authorSearchRequest.titleSentimentMin) && Objects.equals(this.titleSentimentMax, authorSearchRequest.titleSentimentMax) && Objects.equals(this.contentSentimentMin, authorSearchRequest.contentSentimentMin) && Objects.equals(this.contentSentimentMax, authorSearchRequest.contentSentimentMax) && Objects.equals(this.iptcTags, authorSearchRequest.iptcTags) && Objects.equals(this.notIptcTags, authorSearchRequest.notIptcTags) && Objects.equals(this.iabTags, authorSearchRequest.iabTags) && Objects.equals(this.notIabTags, authorSearchRequest.notIabTags)&& Objects.equals(this.additionalProperties, authorSearchRequest.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(authorName, notAuthorName, sources, predefinedSources, notSources, lang, notLang, countries, notCountries, from, to, publishedDatePrecision, byParseDate, sortBy, rankedOnly, fromRank, toRank, isHeadline, isPaidContent, parentUrl, allLinks, allDomainLinks, wordCountMin, wordCountMax, page, pageSize, includeNlpData, hasNlp, theme, notTheme, nerName, titleSentimentMin, titleSentimentMax, contentSentimentMin, contentSentimentMax, iptcTags, notIptcTags, iabTags, notIabTags, 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 AuthorSearchRequest {\n"); sb.append(" authorName: ").append(toIndentedString(authorName)).append("\n"); sb.append(" notAuthorName: ").append(toIndentedString(notAuthorName)).append("\n"); sb.append(" sources: ").append(toIndentedString(sources)).append("\n"); sb.append(" predefinedSources: ").append(toIndentedString(predefinedSources)).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(" publishedDatePrecision: ").append(toIndentedString(publishedDatePrecision)).append("\n"); sb.append(" byParseDate: ").append(toIndentedString(byParseDate)).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(" 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(" nerName: ").append(toIndentedString(nerName)).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(" iabTags: ").append(toIndentedString(iabTags)).append("\n"); sb.append(" notIabTags: ").append(toIndentedString(notIabTags)).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("author_name"); openapiFields.add("not_author_name"); openapiFields.add("sources"); openapiFields.add("predefined_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("published_date_precision"); openapiFields.add("by_parse_date"); openapiFields.add("sort_by"); openapiFields.add("ranked_only"); openapiFields.add("from_rank"); openapiFields.add("to_rank"); openapiFields.add("is_headline"); 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("ner_name"); 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"); openapiFields.add("iab_tags"); openapiFields.add("not_iab_tags"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); openapiRequiredFields.add("author_name"); } /** * 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 AuthorSearchRequest */ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if (jsonObj == null) { if (!AuthorSearchRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null throw new IllegalArgumentException(String.format("The required field(s) %s in AuthorSearchRequest is not found in the empty JSON string", AuthorSearchRequest.openapiRequiredFields.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : AuthorSearchRequest.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("author_name").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `author_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("author_name").toString())); } if ((jsonObj.get("not_author_name") != null && !jsonObj.get("not_author_name").isJsonNull()) && !jsonObj.get("not_author_name").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `not_author_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("not_author_name").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("ranked_only") != null && !jsonObj.get("ranked_only").isJsonNull()) && !jsonObj.get("ranked_only").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `ranked_only` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ranked_only").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())); } if ((jsonObj.get("ner_name") != null && !jsonObj.get("ner_name").isJsonNull()) && !jsonObj.get("ner_name").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `ner_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ner_name").toString())); } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { if (!AuthorSearchRequest.class.isAssignableFrom(type.getRawType())) { return null; // this class only serializes 'AuthorSearchRequest' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); final TypeAdapter thisAdapter = gson.getDelegateAdapter(this, TypeToken.get(AuthorSearchRequest.class)); return (TypeAdapter) new TypeAdapter() { @Override public void write(JsonWriter out, AuthorSearchRequest 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 { obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); } } } elementAdapter.write(out, obj); } @Override public AuthorSearchRequest read(JsonReader in) throws IOException { JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); validateJsonObject(jsonObj); // store additional fields in the deserialized instance AuthorSearchRequest 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 AuthorSearchRequest given an JSON string * * @param jsonString JSON string * @return An instance of AuthorSearchRequest * @throws IOException if the JSON string is invalid with respect to AuthorSearchRequest */ public static AuthorSearchRequest fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, AuthorSearchRequest.class); } /** * Convert an instance of AuthorSearchRequest to an JSON string * * @return JSON string */ public String toJson() { return JSON.getGson().toJson(this); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy