com.factset.sdk.FactSetGlobalPrices.models.BatchStatus Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of factsetglobalprices Show documentation
Show all versions of factsetglobalprices Show documentation
FactSet SDK for Java - factsetglobalprices
/*
* FactSet Global Prices API
* The FactSet Global Prices API provides end of day market pricing content using cloud and microservices technology, encompassing both pricing as well as corporate actions and events data.
*
* The version of the OpenAPI document: 1.7.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.FactSetGlobalPrices.models;
import java.util.Objects;
import java.util.Arrays;
import java.util.Map;
import java.util.HashMap;
import com.factset.sdk.FactSetGlobalPrices.models.BatchErrorObject;
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 java.time.OffsetDateTime;
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.FactSetGlobalPrices.JSON;
/**
* BatchStatus
*/
@JsonPropertyOrder({
BatchStatus.JSON_PROPERTY_ID,
BatchStatus.JSON_PROPERTY_START_TIME,
BatchStatus.JSON_PROPERTY_END_TIME,
BatchStatus.JSON_PROPERTY_STATUS,
BatchStatus.JSON_PROPERTY_ERROR
})
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class BatchStatus implements Serializable {
private static final long serialVersionUID = 1L;
public static final String JSON_PROPERTY_ID = "id";
private java.util.UUID id;
public static final String JSON_PROPERTY_START_TIME = "startTime";
private OffsetDateTime startTime;
public static final String JSON_PROPERTY_END_TIME = "endTime";
private JsonNullable endTime = JsonNullable.undefined();
/**
* Gets or Sets status
*/
public enum StatusEnum {
QUEUED("queued"),
EXECUTING("executing"),
CREATED("created"),
FAILED("failed");
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 BatchStatus() {
}
public BatchStatus id(java.util.UUID id) {
this.id = id;
return this;
}
/**
* the id of batch request.
* @return id
**/
@jakarta.annotation.Nullable
@ApiModelProperty(value = "the id of batch request.")
@JsonProperty(JSON_PROPERTY_ID)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public java.util.UUID getId() {
return id;
}
@JsonProperty(JSON_PROPERTY_ID)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setId(java.util.UUID id) {
this.id = id;
}
public BatchStatus startTime(OffsetDateTime startTime) {
this.startTime = startTime;
return this;
}
/**
* Time when the batch request is started. This is in Eastern Time Zone. The date-time format is expressed as [YYYY-MM-DD]T[HH:MM:SSS], following ISO 8601.
* @return startTime
**/
@jakarta.annotation.Nullable
@ApiModelProperty(value = "Time when the batch request is started. This is in Eastern Time Zone. The date-time format is expressed as [YYYY-MM-DD]T[HH:MM:SSS], following ISO 8601.")
@JsonProperty(JSON_PROPERTY_START_TIME)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public OffsetDateTime getStartTime() {
return startTime;
}
@JsonProperty(JSON_PROPERTY_START_TIME)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setStartTime(OffsetDateTime startTime) {
this.startTime = startTime;
}
public BatchStatus endTime(OffsetDateTime endTime) {
this.endTime = JsonNullable.of(endTime);
return this;
}
/**
* Time when the batch request is ended. This is in Eastern Time Zone. The date-time format is expressed as [YYYY-MM-DD]T[HH:MM:SSS], following ISO 8601.
* @return endTime
**/
@jakarta.annotation.Nullable
@ApiModelProperty(value = "Time when the batch request is ended. This is in Eastern Time Zone. The date-time format is expressed as [YYYY-MM-DD]T[HH:MM:SSS], following ISO 8601.")
@JsonIgnore
public OffsetDateTime getEndTime() {
return endTime.orElse(null);
}
@JsonProperty(JSON_PROPERTY_END_TIME)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public JsonNullable getEndTime_JsonNullable() {
return endTime;
}
@JsonProperty(JSON_PROPERTY_END_TIME)
public void setEndTime_JsonNullable(JsonNullable endTime) {
this.endTime = endTime;
}
public void setEndTime(OffsetDateTime endTime) {
this.endTime = JsonNullable.of(endTime);
}
public BatchStatus status(StatusEnum status) {
this.status = status;
return this;
}
/**
* Get status
* @return status
**/
@jakarta.annotation.Nullable
@ApiModelProperty(value = "")
@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 BatchStatus error(BatchErrorObject error) {
this.error = JsonNullable.of(error);
return this;
}
/**
* Get error
* @return error
**/
@jakarta.annotation.Nullable
@ApiModelProperty(value = "")
@JsonIgnore
public BatchErrorObject 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(BatchErrorObject error) {
this.error = JsonNullable.of(error);
}
/**
* Return true if this BatchStatus object is equal to o.
*/
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
BatchStatus batchStatus = (BatchStatus) o;
return Objects.equals(this.id, batchStatus.id) &&
Objects.equals(this.startTime, batchStatus.startTime) &&
equalsNullable(this.endTime, batchStatus.endTime) &&
Objects.equals(this.status, batchStatus.status) &&
equalsNullable(this.error, batchStatus.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, startTime, hashCodeNullable(endTime), 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 BatchStatus {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" startTime: ").append(toIndentedString(startTime)).append("\n");
sb.append(" endTime: ").append(toIndentedString(endTime)).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 ");
}
}