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 com.muse.dto.QuotaAdjustmentResultAfterSnapshot; 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 = "QuotaAdjustmentResult", description = "配额调整结果") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2026-05-24T15:05:54.603829+08:00[Asia/Shanghai]", comments = "Generator version: 7.22.0") public class QuotaAdjustmentResult implements Serializable { private static final long serialVersionUID = 1L; private String adjustmentId; private String commandId; /** * 调整状态 */ public enum StatusEnum { APPLIED("applied"), IDEMPOTENT_HIT("idempotent_hit"), IDEMPOTENCY_CONFLICT("idempotency_conflict"); 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 QuotaAdjustmentResultAfterSnapshot afterSnapshot; public QuotaAdjustmentResult() { super(); } /** * Constructor with only required parameters */ public QuotaAdjustmentResult(String adjustmentId, String commandId, StatusEnum status) { this.adjustmentId = adjustmentId; this.commandId = commandId; this.status = status; } public QuotaAdjustmentResult adjustmentId(String adjustmentId) { this.adjustmentId = adjustmentId; return this; } /** * 调整记录 ID * @return adjustmentId */ @NotNull @Schema(name = "adjustmentId", description = "调整记录 ID", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("adjustmentId") public String getAdjustmentId() { return adjustmentId; } @JsonProperty("adjustmentId") public void setAdjustmentId(String adjustmentId) { this.adjustmentId = adjustmentId; } public QuotaAdjustmentResult commandId(String commandId) { this.commandId = commandId; return this; } /** * 请求幂等键 * @return commandId */ @NotNull @Schema(name = "commandId", description = "请求幂等键", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("commandId") public String getCommandId() { return commandId; } @JsonProperty("commandId") public void setCommandId(String commandId) { this.commandId = commandId; } public QuotaAdjustmentResult 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 QuotaAdjustmentResult afterSnapshot(@Nullable QuotaAdjustmentResultAfterSnapshot afterSnapshot) { this.afterSnapshot = afterSnapshot; return this; } /** * Get afterSnapshot * @return afterSnapshot */ @Valid @Schema(name = "afterSnapshot", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("afterSnapshot") public @Nullable QuotaAdjustmentResultAfterSnapshot getAfterSnapshot() { return afterSnapshot; } @JsonProperty("afterSnapshot") public void setAfterSnapshot(@Nullable QuotaAdjustmentResultAfterSnapshot afterSnapshot) { this.afterSnapshot = afterSnapshot; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } QuotaAdjustmentResult quotaAdjustmentResult = (QuotaAdjustmentResult) o; return Objects.equals(this.adjustmentId, quotaAdjustmentResult.adjustmentId) && Objects.equals(this.commandId, quotaAdjustmentResult.commandId) && Objects.equals(this.status, quotaAdjustmentResult.status) && Objects.equals(this.afterSnapshot, quotaAdjustmentResult.afterSnapshot); } @Override public int hashCode() { return Objects.hash(adjustmentId, commandId, status, afterSnapshot); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class QuotaAdjustmentResult {\n"); sb.append(" adjustmentId: ").append(toIndentedString(adjustmentId)).append("\n"); sb.append(" commandId: ").append(toIndentedString(commandId)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); sb.append(" afterSnapshot: ").append(toIndentedString(afterSnapshot)).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 "); } }