com.wultra.app.onboardingserver.provider.zenid.model.api.ZenidWebInvestigateResponse Maven / Gradle / Ivy
The newest version!
/*
* ZenidWeb
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: v1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package com.wultra.app.onboardingserver.provider.zenid.model.api;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.StringJoiner;
import java.util.Objects;
import java.util.Map;
import java.util.HashMap;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import com.wultra.app.onboardingserver.provider.zenid.model.api.RecogLibRankDetail;
import com.wultra.app.onboardingserver.provider.zenid.model.api.ZenidSharedMineAllResult;
import com.wultra.app.onboardingserver.provider.zenid.model.api.ZenidWebInvestigationValidatorResponse;
import java.time.OffsetDateTime;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.wultra.app.onboardingserver.provider.zenid.model.ApiClient;
/**
* Response object for the investigation nodes.
*/
@JsonPropertyOrder({
ZenidWebInvestigateResponse.JSON_PROPERTY_INVESTIGATION_I_D,
ZenidWebInvestigateResponse.JSON_PROPERTY_CUSTOM_DATA,
ZenidWebInvestigateResponse.JSON_PROPERTY_MINED_DATA,
ZenidWebInvestigateResponse.JSON_PROPERTY_DOCUMENTS_DATA,
ZenidWebInvestigateResponse.JSON_PROPERTY_INVESTIGATION_URL,
ZenidWebInvestigateResponse.JSON_PROPERTY_RANK,
ZenidWebInvestigateResponse.JSON_PROPERTY_TIME,
ZenidWebInvestigateResponse.JSON_PROPERTY_VALIDATOR_RESULTS,
ZenidWebInvestigateResponse.JSON_PROPERTY_STATE,
ZenidWebInvestigateResponse.JSON_PROPERTY_ERROR_CODE,
ZenidWebInvestigateResponse.JSON_PROPERTY_ERROR_TEXT,
ZenidWebInvestigateResponse.JSON_PROPERTY_PROCESSING_TIME_MS,
ZenidWebInvestigateResponse.JSON_PROPERTY_MESSAGE_TYPE
})
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0")
public class ZenidWebInvestigateResponse {
public static final String JSON_PROPERTY_INVESTIGATION_I_D = "InvestigationID";
private Integer investigationID;
public static final String JSON_PROPERTY_CUSTOM_DATA = "CustomData";
private String customData;
public static final String JSON_PROPERTY_MINED_DATA = "MinedData";
private ZenidSharedMineAllResult minedData;
public static final String JSON_PROPERTY_DOCUMENTS_DATA = "DocumentsData";
private List documentsData = new ArrayList<>();
public static final String JSON_PROPERTY_INVESTIGATION_URL = "InvestigationUrl";
private String investigationUrl;
public static final String JSON_PROPERTY_RANK = "Rank";
private RecogLibRankDetail rank;
public static final String JSON_PROPERTY_TIME = "Time";
private OffsetDateTime time;
public static final String JSON_PROPERTY_VALIDATOR_RESULTS = "ValidatorResults";
private List validatorResults = new ArrayList<>();
/**
* State of the request - NotDone/Done/Error
*/
public enum StateEnum {
NOT_DONE("NotDone"),
DONE("Done"),
ERROR("Error"),
OPERATOR("Operator"),
REJECTED("Rejected"),
ARCHIVED("Archived");
private String value;
StateEnum(String value) {
this.value = value;
}
@JsonValue
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
@JsonCreator
public static StateEnum fromValue(String value) {
for (StateEnum b : StateEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
}
public static final String JSON_PROPERTY_STATE = "State";
private StateEnum state;
/**
* If throght processing some error occurs, ErrorCode property is set.
*/
public enum ErrorCodeEnum {
UNKNOWN_SAMPLE_ID("UnknownSampleID"),
UNKNOWN_UPLOAD_SESSION_ID("UnknownUploadSessionID"),
EMPTY_BODY("EmptyBody"),
INTERNAL_SERVER_ERROR("InternalServerError"),
INVALID_TIME_STAMP("InvalidTimeStamp"),
SAMPLE_IN_INVALID_STATE("SampleInInvalidState"),
INVALID_SAMPLE_COMBINATION("InvalidSampleCombination"),
ACCESS_DENIED("AccessDenied"),
UNKNOWN_PERSON("UnknownPerson"),
INVALID_INPUT_DATA("InvalidInputData"),
INIT_SDK_RECREATES_SESSION_ERROR("InitSDKRecreatesSessionError");
private String value;
ErrorCodeEnum(String value) {
this.value = value;
}
@JsonValue
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
@JsonCreator
public static ErrorCodeEnum fromValue(String value) {
for (ErrorCodeEnum b : ErrorCodeEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
}
public static final String JSON_PROPERTY_ERROR_CODE = "ErrorCode";
private ErrorCodeEnum errorCode;
public static final String JSON_PROPERTY_ERROR_TEXT = "ErrorText";
private String errorText;
public static final String JSON_PROPERTY_PROCESSING_TIME_MS = "ProcessingTimeMs";
private Long processingTimeMs;
public static final String JSON_PROPERTY_MESSAGE_TYPE = "MessageType";
private String messageType;
public ZenidWebInvestigateResponse() {
}
@JsonCreator
public ZenidWebInvestigateResponse(
@JsonProperty(JSON_PROPERTY_MESSAGE_TYPE) String messageType
) {
this();
this.messageType = messageType;
}
public ZenidWebInvestigateResponse investigationID(Integer investigationID) {
this.investigationID = investigationID;
return this;
}
/**
* Unique identification of the investigation (set of samples)
* @return investigationID
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_INVESTIGATION_I_D)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public Integer getInvestigationID() {
return investigationID;
}
@JsonProperty(JSON_PROPERTY_INVESTIGATION_I_D)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setInvestigationID(Integer investigationID) {
this.investigationID = investigationID;
}
public ZenidWebInvestigateResponse customData(String customData) {
this.customData = customData;
return this;
}
/**
* Copy of the input parameter CustomData
* @return customData
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_CUSTOM_DATA)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getCustomData() {
return customData;
}
@JsonProperty(JSON_PROPERTY_CUSTOM_DATA)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setCustomData(String customData) {
this.customData = customData;
}
public ZenidWebInvestigateResponse minedData(ZenidSharedMineAllResult minedData) {
this.minedData = minedData;
return this;
}
/**
* Get minedData
* @return minedData
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_MINED_DATA)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public ZenidSharedMineAllResult getMinedData() {
return minedData;
}
@JsonProperty(JSON_PROPERTY_MINED_DATA)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setMinedData(ZenidSharedMineAllResult minedData) {
this.minedData = minedData;
}
public ZenidWebInvestigateResponse documentsData(List documentsData) {
this.documentsData = documentsData;
return this;
}
public ZenidWebInvestigateResponse addDocumentsDataItem(ZenidSharedMineAllResult documentsDataItem) {
if (this.documentsData == null) {
this.documentsData = new ArrayList<>();
}
this.documentsData.add(documentsDataItem);
return this;
}
/**
* If investigation covers multiple documents, each will have their own entry here
* @return documentsData
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_DOCUMENTS_DATA)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public List getDocumentsData() {
return documentsData;
}
@JsonProperty(JSON_PROPERTY_DOCUMENTS_DATA)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setDocumentsData(List documentsData) {
this.documentsData = documentsData;
}
public ZenidWebInvestigateResponse investigationUrl(String investigationUrl) {
this.investigationUrl = investigationUrl;
return this;
}
/**
* URL of the investigation detail
* @return investigationUrl
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_INVESTIGATION_URL)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getInvestigationUrl() {
return investigationUrl;
}
@JsonProperty(JSON_PROPERTY_INVESTIGATION_URL)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setInvestigationUrl(String investigationUrl) {
this.investigationUrl = investigationUrl;
}
public ZenidWebInvestigateResponse rank(RecogLibRankDetail rank) {
this.rank = rank;
return this;
}
/**
* Get rank
* @return rank
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_RANK)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public RecogLibRankDetail getRank() {
return rank;
}
@JsonProperty(JSON_PROPERTY_RANK)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setRank(RecogLibRankDetail rank) {
this.rank = rank;
}
public ZenidWebInvestigateResponse time(OffsetDateTime time) {
this.time = time;
return this;
}
/**
* Time of investigation (server time)
* @return time
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_TIME)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public OffsetDateTime getTime() {
return time;
}
@JsonProperty(JSON_PROPERTY_TIME)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setTime(OffsetDateTime time) {
this.time = time;
}
public ZenidWebInvestigateResponse validatorResults(List validatorResults) {
this.validatorResults = validatorResults;
return this;
}
public ZenidWebInvestigateResponse addValidatorResultsItem(ZenidWebInvestigationValidatorResponse validatorResultsItem) {
if (this.validatorResults == null) {
this.validatorResults = new ArrayList<>();
}
this.validatorResults.add(validatorResultsItem);
return this;
}
/**
* Result of the all validators - List of {ZenidWeb.InvestigationValidatorResponse}
* @return validatorResults
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_VALIDATOR_RESULTS)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public List getValidatorResults() {
return validatorResults;
}
@JsonProperty(JSON_PROPERTY_VALIDATOR_RESULTS)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setValidatorResults(List validatorResults) {
this.validatorResults = validatorResults;
}
public ZenidWebInvestigateResponse state(StateEnum state) {
this.state = state;
return this;
}
/**
* State of the request - NotDone/Done/Error
* @return state
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_STATE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public StateEnum getState() {
return state;
}
@JsonProperty(JSON_PROPERTY_STATE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setState(StateEnum state) {
this.state = state;
}
public ZenidWebInvestigateResponse errorCode(ErrorCodeEnum errorCode) {
this.errorCode = errorCode;
return this;
}
/**
* If throght processing some error occurs, ErrorCode property is set.
* @return errorCode
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_ERROR_CODE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public ErrorCodeEnum getErrorCode() {
return errorCode;
}
@JsonProperty(JSON_PROPERTY_ERROR_CODE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setErrorCode(ErrorCodeEnum errorCode) {
this.errorCode = errorCode;
}
public ZenidWebInvestigateResponse errorText(String errorText) {
this.errorText = errorText;
return this;
}
/**
* Error text
* @return errorText
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_ERROR_TEXT)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getErrorText() {
return errorText;
}
@JsonProperty(JSON_PROPERTY_ERROR_TEXT)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setErrorText(String errorText) {
this.errorText = errorText;
}
public ZenidWebInvestigateResponse processingTimeMs(Long processingTimeMs) {
this.processingTimeMs = processingTimeMs;
return this;
}
/**
* Get processingTimeMs
* @return processingTimeMs
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_PROCESSING_TIME_MS)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public Long getProcessingTimeMs() {
return processingTimeMs;
}
@JsonProperty(JSON_PROPERTY_PROCESSING_TIME_MS)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setProcessingTimeMs(Long processingTimeMs) {
this.processingTimeMs = processingTimeMs;
}
/**
* Get messageType
* @return messageType
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_MESSAGE_TYPE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getMessageType() {
return messageType;
}
/**
* Return true if this ZenidWeb.InvestigateResponse object is equal to o.
*/
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ZenidWebInvestigateResponse zenidWebInvestigateResponse = (ZenidWebInvestigateResponse) o;
return Objects.equals(this.investigationID, zenidWebInvestigateResponse.investigationID) &&
Objects.equals(this.customData, zenidWebInvestigateResponse.customData) &&
Objects.equals(this.minedData, zenidWebInvestigateResponse.minedData) &&
Objects.equals(this.documentsData, zenidWebInvestigateResponse.documentsData) &&
Objects.equals(this.investigationUrl, zenidWebInvestigateResponse.investigationUrl) &&
Objects.equals(this.rank, zenidWebInvestigateResponse.rank) &&
Objects.equals(this.time, zenidWebInvestigateResponse.time) &&
Objects.equals(this.validatorResults, zenidWebInvestigateResponse.validatorResults) &&
Objects.equals(this.state, zenidWebInvestigateResponse.state) &&
Objects.equals(this.errorCode, zenidWebInvestigateResponse.errorCode) &&
Objects.equals(this.errorText, zenidWebInvestigateResponse.errorText) &&
Objects.equals(this.processingTimeMs, zenidWebInvestigateResponse.processingTimeMs) &&
Objects.equals(this.messageType, zenidWebInvestigateResponse.messageType);
}
@Override
public int hashCode() {
return Objects.hash(investigationID, customData, minedData, documentsData, investigationUrl, rank, time, validatorResults, state, errorCode, errorText, processingTimeMs, messageType);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ZenidWebInvestigateResponse {\n");
sb.append(" investigationID: ").append(toIndentedString(investigationID)).append("\n");
sb.append(" customData: ").append(toIndentedString(customData)).append("\n");
sb.append(" minedData: ").append(toIndentedString(minedData)).append("\n");
sb.append(" documentsData: ").append(toIndentedString(documentsData)).append("\n");
sb.append(" investigationUrl: ").append(toIndentedString(investigationUrl)).append("\n");
sb.append(" rank: ").append(toIndentedString(rank)).append("\n");
sb.append(" time: ").append(toIndentedString(time)).append("\n");
sb.append(" validatorResults: ").append(toIndentedString(validatorResults)).append("\n");
sb.append(" state: ").append(toIndentedString(state)).append("\n");
sb.append(" errorCode: ").append(toIndentedString(errorCode)).append("\n");
sb.append(" errorText: ").append(toIndentedString(errorText)).append("\n");
sb.append(" processingTimeMs: ").append(toIndentedString(processingTimeMs)).append("\n");
sb.append(" messageType: ").append(toIndentedString(messageType)).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 ");
}
/**
* Convert the instance into URL query string.
*
* @return URL query string
*/
public String toUrlQueryString() {
return toUrlQueryString(null);
}
/**
* Convert the instance into URL query string.
*
* @param prefix prefix of the query string
* @return URL query string
*/
public String toUrlQueryString(String prefix) {
String suffix = "";
String containerSuffix = "";
String containerPrefix = "";
if (prefix == null) {
// style=form, explode=true, e.g. /pet?name=cat&type=manx
prefix = "";
} else {
// deepObject style e.g. /pet?id[name]=cat&id[type]=manx
prefix = prefix + "[";
suffix = "]";
containerSuffix = "]";
containerPrefix = "[";
}
StringJoiner joiner = new StringJoiner("&");
// add `InvestigationID` to the URL query string
if (getInvestigationID() != null) {
joiner.add(String.format("%sInvestigationID%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getInvestigationID()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
}
// add `CustomData` to the URL query string
if (getCustomData() != null) {
joiner.add(String.format("%sCustomData%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getCustomData()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
}
// add `MinedData` to the URL query string
if (getMinedData() != null) {
joiner.add(getMinedData().toUrlQueryString(prefix + "MinedData" + suffix));
}
// add `DocumentsData` to the URL query string
if (getDocumentsData() != null) {
for (int i = 0; i < getDocumentsData().size(); i++) {
if (getDocumentsData().get(i) != null) {
joiner.add(getDocumentsData().get(i).toUrlQueryString(String.format("%sDocumentsData%s%s", prefix, suffix,
"".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix))));
}
}
}
// add `InvestigationUrl` to the URL query string
if (getInvestigationUrl() != null) {
joiner.add(String.format("%sInvestigationUrl%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getInvestigationUrl()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
}
// add `Rank` to the URL query string
if (getRank() != null) {
joiner.add(getRank().toUrlQueryString(prefix + "Rank" + suffix));
}
// add `Time` to the URL query string
if (getTime() != null) {
joiner.add(String.format("%sTime%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getTime()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
}
// add `ValidatorResults` to the URL query string
if (getValidatorResults() != null) {
for (int i = 0; i < getValidatorResults().size(); i++) {
if (getValidatorResults().get(i) != null) {
joiner.add(getValidatorResults().get(i).toUrlQueryString(String.format("%sValidatorResults%s%s", prefix, suffix,
"".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix))));
}
}
}
// add `State` to the URL query string
if (getState() != null) {
joiner.add(String.format("%sState%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getState()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
}
// add `ErrorCode` to the URL query string
if (getErrorCode() != null) {
joiner.add(String.format("%sErrorCode%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getErrorCode()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
}
// add `ErrorText` to the URL query string
if (getErrorText() != null) {
joiner.add(String.format("%sErrorText%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getErrorText()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
}
// add `ProcessingTimeMs` to the URL query string
if (getProcessingTimeMs() != null) {
joiner.add(String.format("%sProcessingTimeMs%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getProcessingTimeMs()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
}
// add `MessageType` to the URL query string
if (getMessageType() != null) {
joiner.add(String.format("%sMessageType%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getMessageType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
}
return joiner.toString();
}
}