com.factset.sdk.FactSetTickHistory.models.StatusOne Maven / Gradle / Ivy
/*
* Tick History
* Tick History provides dynamic access to historical tick data for a specific security for specific dates or date range.
*
* The version of the OpenAPI document: 2.3.0
* Contact: [email protected]
*
* 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.factset.sdk.FactSetTickHistory.models;
import java.util.Objects;
import java.util.Arrays;
import java.util.Map;
import java.util.HashMap;
import com.factset.sdk.FactSetTickHistory.models.ErrorObject;
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 io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.openapitools.jackson.nullable.JsonNullable;
import com.fasterxml.jackson.annotation.JsonIgnore;
import org.openapitools.jackson.nullable.JsonNullable;
import java.util.NoSuchElementException;
import java.io.Serializable;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.factset.sdk.FactSetTickHistory.JSON;
/**
* request-files
*/
@ApiModel(description = "request-files")
@JsonPropertyOrder({
StatusOne.JSON_PROPERTY_ID,
StatusOne.JSON_PROPERTY_STATUS,
StatusOne.JSON_PROPERTY_ERROR
})
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class StatusOne implements Serializable {
private static final long serialVersionUID = 1L;
public static final String JSON_PROPERTY_ID = "id";
private String id;
/**
* The status of the query
*/
public enum StatusEnum {
QUEUED("queued"),
EXECUTING("executing"),
CREATED("created"),
FAILED("failed"),
CANCELLED("cancelled");
private String value;
StatusEnum(String value) {
this.value = value;
}
@JsonValue
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
@JsonCreator
public static StatusEnum fromValue(String value) {
for (StatusEnum b : StatusEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
}
public static final String JSON_PROPERTY_STATUS = "status";
private StatusEnum status;
public static final String JSON_PROPERTY_ERROR = "error";
private JsonNullable error = JsonNullable.undefined();
public StatusOne() {
}
public StatusOne id(String id) {
this.id = id;
return this;
}
/**
* a unique identification for the query requested
* @return id
**/
@jakarta.annotation.Nullable
@ApiModelProperty(value = "a unique identification for the query requested")
@JsonProperty(JSON_PROPERTY_ID)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getId() {
return id;
}
@JsonProperty(JSON_PROPERTY_ID)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setId(String id) {
this.id = id;
}
public StatusOne status(StatusEnum status) {
this.status = status;
return this;
}
/**
* The status of the query
* @return status
**/
@jakarta.annotation.Nullable
@ApiModelProperty(value = "The status of the query")
@JsonProperty(JSON_PROPERTY_STATUS)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public StatusEnum getStatus() {
return status;
}
@JsonProperty(JSON_PROPERTY_STATUS)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setStatus(StatusEnum status) {
this.status = status;
}
public StatusOne error(ErrorObject error) {
this.error = JsonNullable.of(error);
return this;
}
/**
* Get error
* @return error
**/
@jakarta.annotation.Nullable
@ApiModelProperty(value = "")
@JsonIgnore
public ErrorObject getError() {
return error.orElse(null);
}
@JsonProperty(JSON_PROPERTY_ERROR)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public JsonNullable getError_JsonNullable() {
return error;
}
@JsonProperty(JSON_PROPERTY_ERROR)
public void setError_JsonNullable(JsonNullable error) {
this.error = error;
}
public void setError(ErrorObject error) {
this.error = JsonNullable.of(error);
}
/**
* Return true if this StatusOne object is equal to o.
*/
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
StatusOne statusOne = (StatusOne) o;
return Objects.equals(this.id, statusOne.id) &&
Objects.equals(this.status, statusOne.status) &&
equalsNullable(this.error, statusOne.error);
}
private static boolean equalsNullable(JsonNullable a, JsonNullable b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
return Objects.hash(id, status, hashCodeNullable(error));
}
private static int hashCodeNullable(JsonNullable a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class StatusOne {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" status: ").append(toIndentedString(status)).append("\n");
sb.append(" error: ").append(toIndentedString(error)).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 ");
}
}