270 lines
7.2 KiB
Java
270 lines
7.2 KiB
Java
package com.muse.dto;
|
|
|
|
import java.net.URI;
|
|
import java.util.Objects;
|
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
|
import com.fasterxml.jackson.annotation.JsonCreator;
|
|
import com.fasterxml.jackson.annotation.JsonValue;
|
|
import java.time.OffsetDateTime;
|
|
import org.springframework.format.annotation.DateTimeFormat;
|
|
import org.springframework.lang.Nullable;
|
|
import java.io.Serializable;
|
|
import java.time.OffsetDateTime;
|
|
import jakarta.validation.Valid;
|
|
import jakarta.validation.constraints.*;
|
|
import io.swagger.v3.oas.annotations.media.Schema;
|
|
|
|
|
|
import java.util.*;
|
|
import jakarta.annotation.Generated;
|
|
|
|
/**
|
|
* 额度请求状态
|
|
*/
|
|
|
|
@Schema(name = "QuotaRequestStatus", description = "额度请求状态")
|
|
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2026-05-24T16:47:40.290595+08:00[Asia/Shanghai]", comments = "Generator version: 7.22.0")
|
|
public class QuotaRequestStatus implements Serializable {
|
|
|
|
private static final long serialVersionUID = 1L;
|
|
|
|
private String requestId;
|
|
|
|
private String correlationId;
|
|
|
|
/**
|
|
* 请求状态
|
|
*/
|
|
public enum StatusEnum {
|
|
QUEUED("queued"),
|
|
|
|
PROCESSING("processing"),
|
|
|
|
COMPLETED("completed"),
|
|
|
|
FAILED("failed"),
|
|
|
|
IDEMPOTENT_HIT("idempotent_hit");
|
|
|
|
private final 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 + "'");
|
|
}
|
|
}
|
|
|
|
private StatusEnum status;
|
|
|
|
private @Nullable String failedReason;
|
|
|
|
@DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
|
|
private @Nullable OffsetDateTime completedAt;
|
|
|
|
@DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
|
|
private @Nullable OffsetDateTime createdAt;
|
|
|
|
public QuotaRequestStatus() {
|
|
super();
|
|
}
|
|
|
|
/**
|
|
* Constructor with only required parameters
|
|
*/
|
|
public QuotaRequestStatus(String requestId, String correlationId, StatusEnum status) {
|
|
this.requestId = requestId;
|
|
this.correlationId = correlationId;
|
|
this.status = status;
|
|
}
|
|
|
|
public QuotaRequestStatus requestId(String requestId) {
|
|
this.requestId = requestId;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* 额度请求 ID
|
|
* @return requestId
|
|
*/
|
|
@NotNull
|
|
@Schema(name = "requestId", description = "额度请求 ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
|
@JsonProperty("requestId")
|
|
public String getRequestId() {
|
|
return requestId;
|
|
}
|
|
|
|
@JsonProperty("requestId")
|
|
public void setRequestId(String requestId) {
|
|
this.requestId = requestId;
|
|
}
|
|
|
|
public QuotaRequestStatus correlationId(String correlationId) {
|
|
this.correlationId = correlationId;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* 外部调用关联 ID
|
|
* @return correlationId
|
|
*/
|
|
@NotNull
|
|
@Schema(name = "correlationId", description = "外部调用关联 ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
|
@JsonProperty("correlationId")
|
|
public String getCorrelationId() {
|
|
return correlationId;
|
|
}
|
|
|
|
@JsonProperty("correlationId")
|
|
public void setCorrelationId(String correlationId) {
|
|
this.correlationId = correlationId;
|
|
}
|
|
|
|
public QuotaRequestStatus status(StatusEnum status) {
|
|
this.status = status;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* 请求状态
|
|
* @return status
|
|
*/
|
|
@NotNull
|
|
@Schema(name = "status", description = "请求状态", requiredMode = Schema.RequiredMode.REQUIRED)
|
|
@JsonProperty("status")
|
|
public StatusEnum getStatus() {
|
|
return status;
|
|
}
|
|
|
|
@JsonProperty("status")
|
|
public void setStatus(StatusEnum status) {
|
|
this.status = status;
|
|
}
|
|
|
|
public QuotaRequestStatus failedReason(@Nullable String failedReason) {
|
|
this.failedReason = failedReason;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* 失败原因(仅失败时返回)
|
|
* @return failedReason
|
|
*/
|
|
|
|
@Schema(name = "failedReason", description = "失败原因(仅失败时返回)", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
|
@JsonProperty("failedReason")
|
|
public @Nullable String getFailedReason() {
|
|
return failedReason;
|
|
}
|
|
|
|
@JsonProperty("failedReason")
|
|
public void setFailedReason(@Nullable String failedReason) {
|
|
this.failedReason = failedReason;
|
|
}
|
|
|
|
public QuotaRequestStatus completedAt(@Nullable OffsetDateTime completedAt) {
|
|
this.completedAt = completedAt;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* 完成时间
|
|
* @return completedAt
|
|
*/
|
|
@Valid
|
|
@Schema(name = "completedAt", description = "完成时间", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
|
@JsonProperty("completedAt")
|
|
public @Nullable OffsetDateTime getCompletedAt() {
|
|
return completedAt;
|
|
}
|
|
|
|
@JsonProperty("completedAt")
|
|
public void setCompletedAt(@Nullable OffsetDateTime completedAt) {
|
|
this.completedAt = completedAt;
|
|
}
|
|
|
|
public QuotaRequestStatus createdAt(@Nullable OffsetDateTime createdAt) {
|
|
this.createdAt = createdAt;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* 创建时间
|
|
* @return createdAt
|
|
*/
|
|
@Valid
|
|
@Schema(name = "createdAt", description = "创建时间", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
|
@JsonProperty("createdAt")
|
|
public @Nullable OffsetDateTime getCreatedAt() {
|
|
return createdAt;
|
|
}
|
|
|
|
@JsonProperty("createdAt")
|
|
public void setCreatedAt(@Nullable OffsetDateTime createdAt) {
|
|
this.createdAt = createdAt;
|
|
}
|
|
|
|
@Override
|
|
public boolean equals(Object o) {
|
|
if (this == o) {
|
|
return true;
|
|
}
|
|
if (o == null || getClass() != o.getClass()) {
|
|
return false;
|
|
}
|
|
QuotaRequestStatus quotaRequestStatus = (QuotaRequestStatus) o;
|
|
return Objects.equals(this.requestId, quotaRequestStatus.requestId) &&
|
|
Objects.equals(this.correlationId, quotaRequestStatus.correlationId) &&
|
|
Objects.equals(this.status, quotaRequestStatus.status) &&
|
|
Objects.equals(this.failedReason, quotaRequestStatus.failedReason) &&
|
|
Objects.equals(this.completedAt, quotaRequestStatus.completedAt) &&
|
|
Objects.equals(this.createdAt, quotaRequestStatus.createdAt);
|
|
}
|
|
|
|
@Override
|
|
public int hashCode() {
|
|
return Objects.hash(requestId, correlationId, status, failedReason, completedAt, createdAt);
|
|
}
|
|
|
|
@Override
|
|
public String toString() {
|
|
StringBuilder sb = new StringBuilder();
|
|
sb.append("class QuotaRequestStatus {\n");
|
|
sb.append(" requestId: ").append(toIndentedString(requestId)).append("\n");
|
|
sb.append(" correlationId: ").append(toIndentedString(correlationId)).append("\n");
|
|
sb.append(" status: ").append(toIndentedString(status)).append("\n");
|
|
sb.append(" failedReason: ").append(toIndentedString(failedReason)).append("\n");
|
|
sb.append(" completedAt: ").append(toIndentedString(completedAt)).append("\n");
|
|
sb.append(" createdAt: ").append(toIndentedString(createdAt)).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(@Nullable Object o) {
|
|
return o == null ? "null" : o.toString().replace("\n", "\n ");
|
|
}
|
|
}
|
|
|