com.github.tjake.jlama.net.openai.model.ErrorEvent Maven / Gradle / Ivy
/*
* OpenAI API
* The OpenAI REST API. Please see https://platform.openai.com/docs/api-reference for more details.
*
* The version of the OpenAPI document: 2.1.0
*
*
* 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.github.tjake.jlama.net.openai.model;
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.github.tjake.jlama.net.openai.model.Error;
import java.util.Arrays;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import jakarta.validation.constraints.*;
import jakarta.validation.Valid;
import org.hibernate.validator.constraints.*;
import com.github.tjake.jlama.net.openai.JSON;
/**
* Occurs when an [error](/docs/guides/error-codes/api-errors) occurs. This can happen due to an internal server error or a timeout.
*/
@JsonPropertyOrder({
ErrorEvent.JSON_PROPERTY_EVENT,
ErrorEvent.JSON_PROPERTY_DATA
})
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0")
public class ErrorEvent {
/**
* Gets or Sets event
*/
public enum EventEnum {
ERROR("error");
private String value;
EventEnum(String value) {
this.value = value;
}
@JsonValue
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
@JsonCreator
public static EventEnum fromValue(String value) {
for (EventEnum b : EventEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
}
public static final String JSON_PROPERTY_EVENT = "event";
private EventEnum event;
public static final String JSON_PROPERTY_DATA = "data";
private Error data;
public ErrorEvent() {
}
public ErrorEvent event(EventEnum event) {
this.event = event;
return this;
}
/**
* Get event
* @return event
*/
@jakarta.annotation.Nonnull
@NotNull
@JsonProperty(JSON_PROPERTY_EVENT)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public EventEnum getEvent() {
return event;
}
@JsonProperty(JSON_PROPERTY_EVENT)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public void setEvent(EventEnum event) {
this.event = event;
}
public ErrorEvent data(Error data) {
this.data = data;
return this;
}
/**
* Get data
* @return data
*/
@jakarta.annotation.Nonnull
@NotNull
@Valid
@JsonProperty(JSON_PROPERTY_DATA)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public Error getData() {
return data;
}
@JsonProperty(JSON_PROPERTY_DATA)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public void setData(Error data) {
this.data = data;
}
/**
* Return true if this ErrorEvent object is equal to o.
*/
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ErrorEvent errorEvent = (ErrorEvent) o;
return Objects.equals(this.event, errorEvent.event) &&
Objects.equals(this.data, errorEvent.data);
}
@Override
public int hashCode() {
return Objects.hash(event, data);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ErrorEvent {\n");
sb.append(" event: ").append(toIndentedString(event)).append("\n");
sb.append(" data: ").append(toIndentedString(data)).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 ");
}
}