Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,12 @@ public class Healthcheck {
@javax.annotation.Nullable
private Map<String, Object> metadata;

public static final String SERIALIZED_NAME_COUNTRY_FILTER = "countryFilter";

@SerializedName(SERIALIZED_NAME_COUNTRY_FILTER)
@javax.annotation.Nullable
private List<String> countryFilter;

public static final String SERIALIZED_NAME_DOCUMENTS_DATABASE = "documentsDatabase";

@SerializedName(SERIALIZED_NAME_DOCUMENTS_DATABASE)
Expand Down Expand Up @@ -262,6 +268,34 @@ public void setMetadata(@javax.annotation.Nullable Map<String, Object> metadata)
this.metadata = metadata;
}

public Healthcheck countryFilter(@javax.annotation.Nullable List<String> countryFilter) {
this.countryFilter = countryFilter;
return this;
}

public Healthcheck addCountryFilterItem(String countryFilterItem) {
if (this.countryFilter == null) {
this.countryFilter = new ArrayList<>();
}
this.countryFilter.add(countryFilterItem);
return this;
}

/**
* The list of country identifiers that are defined for processing in the license. If the array is
* empty, there are no restrictions for processing.
*
* @return countryFilter
*/
@javax.annotation.Nullable
public List<String> getCountryFilter() {
return countryFilter;
}

public void setCountryFilter(@javax.annotation.Nullable List<String> countryFilter) {
this.countryFilter = countryFilter;
}

public Healthcheck documentsDatabase(
@javax.annotation.Nullable HealthcheckDocumentsDatabase documentsDatabase) {
this.documentsDatabase = documentsDatabase;
Expand Down Expand Up @@ -300,6 +334,7 @@ public boolean equals(Object o) {
&& Objects.equals(this.scenarios, healthcheck.scenarios)
&& Objects.equals(this.version, healthcheck.version)
&& Objects.equals(this.metadata, healthcheck.metadata)
&& Objects.equals(this.countryFilter, healthcheck.countryFilter)
&& Objects.equals(this.documentsDatabase, healthcheck.documentsDatabase);
}

Expand All @@ -314,6 +349,7 @@ public int hashCode() {
scenarios,
version,
metadata,
countryFilter,
documentsDatabase);
}

Expand All @@ -329,6 +365,7 @@ public String toString() {
sb.append(" scenarios: ").append(toIndentedString(scenarios)).append("\n");
sb.append(" version: ").append(toIndentedString(version)).append("\n");
sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n");
sb.append(" countryFilter: ").append(toIndentedString(countryFilter)).append("\n");
sb.append(" documentsDatabase: ").append(toIndentedString(documentsDatabase)).append("\n");
sb.append("}");
return sb.toString();
Expand Down Expand Up @@ -360,6 +397,7 @@ private String toIndentedString(Object o) {
"scenarios",
"version",
"metadata",
"countryFilter",
"documentsDatabase"));

// a set of required properties/fields (JSON key names)
Expand Down Expand Up @@ -446,6 +484,15 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
"Expected the field `version` to be a primitive type in the JSON string but got `%s`",
jsonObj.get("version").toString()));
}
// ensure the optional json data is an array if present
if (jsonObj.get("countryFilter") != null
&& !jsonObj.get("countryFilter").isJsonNull()
&& !jsonObj.get("countryFilter").isJsonArray()) {
System.err.println(
String.format(
"Expected the field `countryFilter` to be an array in the JSON string but got `%s`",
jsonObj.get("countryFilter").toString()));
}
// validate the optional field `documentsDatabase`
if (jsonObj.get("documentsDatabase") != null
&& !jsonObj.get("documentsDatabase").isJsonNull()) {
Expand Down
Loading