com.wultra.app.onboardingserver.provider.zenid.model.api.ZenidWebUploadFaceResponse 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 java.util.Arrays;
import java.util.UUID;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.wultra.app.onboardingserver.provider.zenid.model.ApiClient;
/**
* Return object for /api/face
*/
@JsonPropertyOrder({
ZenidWebUploadFaceResponse.JSON_PROPERTY_UPLOAD_FACE_RESULT,
ZenidWebUploadFaceResponse.JSON_PROPERTY_ORIGINAL_IMAGE_HASH,
ZenidWebUploadFaceResponse.JSON_PROPERTY_PERSISTED_FACE,
ZenidWebUploadFaceResponse.JSON_PROPERTY_ERROR_CODE,
ZenidWebUploadFaceResponse.JSON_PROPERTY_ERROR_TEXT,
ZenidWebUploadFaceResponse.JSON_PROPERTY_PROCESSING_TIME_MS,
ZenidWebUploadFaceResponse.JSON_PROPERTY_MESSAGE_TYPE
})
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0")
public class ZenidWebUploadFaceResponse {
/**
* Possibly result of the upload face photo
*/
public enum UploadFaceResultEnum {
OK("Ok"),
FACE_NOT_DETECTED("FaceNotDetected"),
IMAGE_EXISTS_WITH_DIFFERENT_CUSTOMER_DATA("ImageExistsWithDifferentCustomerData");
private String value;
UploadFaceResultEnum(String value) {
this.value = value;
}
@JsonValue
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
@JsonCreator
public static UploadFaceResultEnum fromValue(String value) {
for (UploadFaceResultEnum b : UploadFaceResultEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
}
public static final String JSON_PROPERTY_UPLOAD_FACE_RESULT = "UploadFaceResult";
private UploadFaceResultEnum uploadFaceResult;
public static final String JSON_PROPERTY_ORIGINAL_IMAGE_HASH = "OriginalImageHash";
private String originalImageHash;
public static final String JSON_PROPERTY_PERSISTED_FACE = "PersistedFace";
private UUID persistedFace;
/**
* 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 ZenidWebUploadFaceResponse() {
}
@JsonCreator
public ZenidWebUploadFaceResponse(
@JsonProperty(JSON_PROPERTY_MESSAGE_TYPE) String messageType
) {
this();
this.messageType = messageType;
}
public ZenidWebUploadFaceResponse uploadFaceResult(UploadFaceResultEnum uploadFaceResult) {
this.uploadFaceResult = uploadFaceResult;
return this;
}
/**
* Possibly result of the upload face photo
* @return uploadFaceResult
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_UPLOAD_FACE_RESULT)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public UploadFaceResultEnum getUploadFaceResult() {
return uploadFaceResult;
}
@JsonProperty(JSON_PROPERTY_UPLOAD_FACE_RESULT)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setUploadFaceResult(UploadFaceResultEnum uploadFaceResult) {
this.uploadFaceResult = uploadFaceResult;
}
public ZenidWebUploadFaceResponse originalImageHash(String originalImageHash) {
this.originalImageHash = originalImageHash;
return this;
}
/**
* hash of the original image
* @return originalImageHash
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_ORIGINAL_IMAGE_HASH)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getOriginalImageHash() {
return originalImageHash;
}
@JsonProperty(JSON_PROPERTY_ORIGINAL_IMAGE_HASH)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setOriginalImageHash(String originalImageHash) {
this.originalImageHash = originalImageHash;
}
public ZenidWebUploadFaceResponse persistedFace(UUID persistedFace) {
this.persistedFace = persistedFace;
return this;
}
/**
* GUID - link of the face image in the Oxford API repository
* @return persistedFace
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_PERSISTED_FACE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public UUID getPersistedFace() {
return persistedFace;
}
@JsonProperty(JSON_PROPERTY_PERSISTED_FACE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setPersistedFace(UUID persistedFace) {
this.persistedFace = persistedFace;
}
public ZenidWebUploadFaceResponse 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 ZenidWebUploadFaceResponse 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 ZenidWebUploadFaceResponse 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.UploadFaceResponse object is equal to o.
*/
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ZenidWebUploadFaceResponse zenidWebUploadFaceResponse = (ZenidWebUploadFaceResponse) o;
return Objects.equals(this.uploadFaceResult, zenidWebUploadFaceResponse.uploadFaceResult) &&
Objects.equals(this.originalImageHash, zenidWebUploadFaceResponse.originalImageHash) &&
Objects.equals(this.persistedFace, zenidWebUploadFaceResponse.persistedFace) &&
Objects.equals(this.errorCode, zenidWebUploadFaceResponse.errorCode) &&
Objects.equals(this.errorText, zenidWebUploadFaceResponse.errorText) &&
Objects.equals(this.processingTimeMs, zenidWebUploadFaceResponse.processingTimeMs) &&
Objects.equals(this.messageType, zenidWebUploadFaceResponse.messageType);
}
@Override
public int hashCode() {
return Objects.hash(uploadFaceResult, originalImageHash, persistedFace, errorCode, errorText, processingTimeMs, messageType);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ZenidWebUploadFaceResponse {\n");
sb.append(" uploadFaceResult: ").append(toIndentedString(uploadFaceResult)).append("\n");
sb.append(" originalImageHash: ").append(toIndentedString(originalImageHash)).append("\n");
sb.append(" persistedFace: ").append(toIndentedString(persistedFace)).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 `UploadFaceResult` to the URL query string
if (getUploadFaceResult() != null) {
joiner.add(String.format("%sUploadFaceResult%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getUploadFaceResult()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
}
// add `OriginalImageHash` to the URL query string
if (getOriginalImageHash() != null) {
joiner.add(String.format("%sOriginalImageHash%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getOriginalImageHash()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
}
// add `PersistedFace` to the URL query string
if (getPersistedFace() != null) {
joiner.add(String.format("%sPersistedFace%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getPersistedFace()), 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();
}
}