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.QuotaAdjustmentLedgerEntryAfterSnapshot; import com.muse.dto.QuotaAdjustmentLedgerEntryBeforeSnapshot; 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; /** * 配额调整 ledger 记录 */ @Schema(name = "QuotaAdjustmentLedgerEntry", description = "配额调整 ledger 记录") @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 QuotaAdjustmentLedgerEntry implements Serializable { private static final long serialVersionUID = 1L; private String adjustmentId; private String commandId; /** * 调整来源类型 */ public enum SourceTypeEnum { MANUAL("manual"), PLAN_CHANGE("plan_change"), MARKET_COMPENSATION("market_compensation"), EXPORT_ROLLBACK("export_rollback"), NEWAPI_CALLBACK("newapi_callback"); private final String value; SourceTypeEnum(String value) { this.value = value; } @JsonValue public String getValue() { return value; } @Override public String toString() { return String.valueOf(value); } @JsonCreator public static SourceTypeEnum fromValue(String value) { for (SourceTypeEnum b : SourceTypeEnum.values()) { if (b.value.equals(value)) { return b; } } throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } private SourceTypeEnum sourceType; private String resourceType; private Integer delta; private @Nullable QuotaAdjustmentLedgerEntryBeforeSnapshot beforeSnapshot; private @Nullable QuotaAdjustmentLedgerEntryAfterSnapshot afterSnapshot; private @Nullable String correlationId; private @Nullable String reason; private String operatorSummary; /** * 审计状态 */ public enum AuditStatusEnum { AUDITED("audited"), PENDING_AUDIT("pending_audit"); private final String value; AuditStatusEnum(String value) { this.value = value; } @JsonValue public String getValue() { return value; } @Override public String toString() { return String.valueOf(value); } @JsonCreator public static AuditStatusEnum fromValue(String value) { for (AuditStatusEnum b : AuditStatusEnum.values()) { if (b.value.equals(value)) { return b; } } throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } private @Nullable AuditStatusEnum auditStatus; @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime createdAt; public QuotaAdjustmentLedgerEntry() { super(); } /** * Constructor with only required parameters */ public QuotaAdjustmentLedgerEntry(String adjustmentId, String commandId, SourceTypeEnum sourceType, String resourceType, Integer delta, String operatorSummary, OffsetDateTime createdAt) { this.adjustmentId = adjustmentId; this.commandId = commandId; this.sourceType = sourceType; this.resourceType = resourceType; this.delta = delta; this.operatorSummary = operatorSummary; this.createdAt = createdAt; } public QuotaAdjustmentLedgerEntry 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 QuotaAdjustmentLedgerEntry 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 QuotaAdjustmentLedgerEntry sourceType(SourceTypeEnum sourceType) { this.sourceType = sourceType; return this; } /** * 调整来源类型 * @return sourceType */ @NotNull @Schema(name = "sourceType", description = "调整来源类型", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("sourceType") public SourceTypeEnum getSourceType() { return sourceType; } @JsonProperty("sourceType") public void setSourceType(SourceTypeEnum sourceType) { this.sourceType = sourceType; } public QuotaAdjustmentLedgerEntry resourceType(String resourceType) { this.resourceType = resourceType; return this; } /** * 权益资源类型 * @return resourceType */ @NotNull @Schema(name = "resourceType", description = "权益资源类型", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("resourceType") public String getResourceType() { return resourceType; } @JsonProperty("resourceType") public void setResourceType(String resourceType) { this.resourceType = resourceType; } public QuotaAdjustmentLedgerEntry delta(Integer delta) { this.delta = delta; return this; } /** * 调整增量 * @return delta */ @NotNull @Schema(name = "delta", description = "调整增量", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("delta") public Integer getDelta() { return delta; } @JsonProperty("delta") public void setDelta(Integer delta) { this.delta = delta; } public QuotaAdjustmentLedgerEntry beforeSnapshot(@Nullable QuotaAdjustmentLedgerEntryBeforeSnapshot beforeSnapshot) { this.beforeSnapshot = beforeSnapshot; return this; } /** * Get beforeSnapshot * @return beforeSnapshot */ @Valid @Schema(name = "beforeSnapshot", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("beforeSnapshot") public @Nullable QuotaAdjustmentLedgerEntryBeforeSnapshot getBeforeSnapshot() { return beforeSnapshot; } @JsonProperty("beforeSnapshot") public void setBeforeSnapshot(@Nullable QuotaAdjustmentLedgerEntryBeforeSnapshot beforeSnapshot) { this.beforeSnapshot = beforeSnapshot; } public QuotaAdjustmentLedgerEntry afterSnapshot(@Nullable QuotaAdjustmentLedgerEntryAfterSnapshot afterSnapshot) { this.afterSnapshot = afterSnapshot; return this; } /** * Get afterSnapshot * @return afterSnapshot */ @Valid @Schema(name = "afterSnapshot", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("afterSnapshot") public @Nullable QuotaAdjustmentLedgerEntryAfterSnapshot getAfterSnapshot() { return afterSnapshot; } @JsonProperty("afterSnapshot") public void setAfterSnapshot(@Nullable QuotaAdjustmentLedgerEntryAfterSnapshot afterSnapshot) { this.afterSnapshot = afterSnapshot; } public QuotaAdjustmentLedgerEntry correlationId(@Nullable String correlationId) { this.correlationId = correlationId; return this; } /** * 关联外部调用 ID * @return correlationId */ @Schema(name = "correlationId", description = "关联外部调用 ID", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("correlationId") public @Nullable String getCorrelationId() { return correlationId; } @JsonProperty("correlationId") public void setCorrelationId(@Nullable String correlationId) { this.correlationId = correlationId; } public QuotaAdjustmentLedgerEntry reason(@Nullable String reason) { this.reason = reason; return this; } /** * 调整原因 * @return reason */ @Schema(name = "reason", description = "调整原因", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("reason") public @Nullable String getReason() { return reason; } @JsonProperty("reason") public void setReason(@Nullable String reason) { this.reason = reason; } public QuotaAdjustmentLedgerEntry operatorSummary(String operatorSummary) { this.operatorSummary = operatorSummary; return this; } /** * 操作者摘要(脱敏) * @return operatorSummary */ @NotNull @Schema(name = "operatorSummary", description = "操作者摘要(脱敏)", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("operatorSummary") public String getOperatorSummary() { return operatorSummary; } @JsonProperty("operatorSummary") public void setOperatorSummary(String operatorSummary) { this.operatorSummary = operatorSummary; } public QuotaAdjustmentLedgerEntry auditStatus(@Nullable AuditStatusEnum auditStatus) { this.auditStatus = auditStatus; return this; } /** * 审计状态 * @return auditStatus */ @Schema(name = "auditStatus", description = "审计状态", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("auditStatus") public @Nullable AuditStatusEnum getAuditStatus() { return auditStatus; } @JsonProperty("auditStatus") public void setAuditStatus(@Nullable AuditStatusEnum auditStatus) { this.auditStatus = auditStatus; } public QuotaAdjustmentLedgerEntry createdAt(OffsetDateTime createdAt) { this.createdAt = createdAt; return this; } /** * 调整时间 * @return createdAt */ @NotNull @Valid @Schema(name = "createdAt", description = "调整时间", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("createdAt") public OffsetDateTime getCreatedAt() { return createdAt; } @JsonProperty("createdAt") public void setCreatedAt(OffsetDateTime createdAt) { this.createdAt = createdAt; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } QuotaAdjustmentLedgerEntry quotaAdjustmentLedgerEntry = (QuotaAdjustmentLedgerEntry) o; return Objects.equals(this.adjustmentId, quotaAdjustmentLedgerEntry.adjustmentId) && Objects.equals(this.commandId, quotaAdjustmentLedgerEntry.commandId) && Objects.equals(this.sourceType, quotaAdjustmentLedgerEntry.sourceType) && Objects.equals(this.resourceType, quotaAdjustmentLedgerEntry.resourceType) && Objects.equals(this.delta, quotaAdjustmentLedgerEntry.delta) && Objects.equals(this.beforeSnapshot, quotaAdjustmentLedgerEntry.beforeSnapshot) && Objects.equals(this.afterSnapshot, quotaAdjustmentLedgerEntry.afterSnapshot) && Objects.equals(this.correlationId, quotaAdjustmentLedgerEntry.correlationId) && Objects.equals(this.reason, quotaAdjustmentLedgerEntry.reason) && Objects.equals(this.operatorSummary, quotaAdjustmentLedgerEntry.operatorSummary) && Objects.equals(this.auditStatus, quotaAdjustmentLedgerEntry.auditStatus) && Objects.equals(this.createdAt, quotaAdjustmentLedgerEntry.createdAt); } @Override public int hashCode() { return Objects.hash(adjustmentId, commandId, sourceType, resourceType, delta, beforeSnapshot, afterSnapshot, correlationId, reason, operatorSummary, auditStatus, createdAt); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class QuotaAdjustmentLedgerEntry {\n"); sb.append(" adjustmentId: ").append(toIndentedString(adjustmentId)).append("\n"); sb.append(" commandId: ").append(toIndentedString(commandId)).append("\n"); sb.append(" sourceType: ").append(toIndentedString(sourceType)).append("\n"); sb.append(" resourceType: ").append(toIndentedString(resourceType)).append("\n"); sb.append(" delta: ").append(toIndentedString(delta)).append("\n"); sb.append(" beforeSnapshot: ").append(toIndentedString(beforeSnapshot)).append("\n"); sb.append(" afterSnapshot: ").append(toIndentedString(afterSnapshot)).append("\n"); sb.append(" correlationId: ").append(toIndentedString(correlationId)).append("\n"); sb.append(" reason: ").append(toIndentedString(reason)).append("\n"); sb.append(" operatorSummary: ").append(toIndentedString(operatorSummary)).append("\n"); sb.append(" auditStatus: ").append(toIndentedString(auditStatus)).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 "); } }