com.clinia.model.common.V1Error Maven / Gradle / Ivy
// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost
// - read more on https://github.com/clinia/api-clients-generation. DO NOT EDIT.
package com.clinia.model.common;
import com.fasterxml.jackson.annotation.*;
import com.fasterxml.jackson.databind.annotation.*;
import java.util.Objects;
/** V1Error */
public class V1Error {
/** Gets or Sets code */
public enum CodeEnum {
NUMBER_400(400),
NUMBER_401(401),
NUMBER_403(403),
NUMBER_404(404),
NUMBER_409(409),
NUMBER_500(500),
NUMBER_501(501);
private Integer value;
CodeEnum(Integer value) {
this.value = value;
}
@JsonValue
public Integer getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
@JsonCreator
public static CodeEnum fromValue(Integer value) {
for (CodeEnum b : CodeEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
}
@JsonProperty("code")
private CodeEnum code;
@JsonProperty("message")
private String message;
@JsonProperty("type")
private V1ErrorType type;
public V1Error setCode(CodeEnum code) {
this.code = code;
return this;
}
/** Get code */
@javax.annotation.Nonnull
public CodeEnum getCode() {
return code;
}
public V1Error setMessage(String message) {
this.message = message;
return this;
}
/** Get message */
@javax.annotation.Nonnull
public String getMessage() {
return message;
}
public V1Error setType(V1ErrorType type) {
this.type = type;
return this;
}
/** Get type */
@javax.annotation.Nonnull
public V1ErrorType getType() {
return type;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
V1Error v1Error = (V1Error) o;
return (
Objects.equals(this.code, v1Error.code) && Objects.equals(this.message, v1Error.message) && Objects.equals(this.type, v1Error.type)
);
}
@Override
public int hashCode() {
return Objects.hash(code, message, type);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class V1Error {\n");
sb.append(" code: ").append(toIndentedString(code)).append("\n");
sb.append(" message: ").append(toIndentedString(message)).append("\n");
sb.append(" type: ").append(toIndentedString(type)).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 ");
}
}