280 lines
7.9 KiB
Java
280 lines
7.9 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 java.math.BigDecimal;
|
|
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 = "BalanceSnapshotEntry", 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 BalanceSnapshotEntry implements Serializable {
|
|
|
|
private static final long serialVersionUID = 1L;
|
|
|
|
private String snapshotId;
|
|
|
|
private String resourceType;
|
|
|
|
private BigDecimal balance;
|
|
|
|
private @Nullable Integer usedQuota;
|
|
|
|
private @Nullable Integer totalQuota;
|
|
|
|
@DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
|
|
private @Nullable OffsetDateTime expiresAt;
|
|
|
|
@DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
|
|
private OffsetDateTime capturedAt;
|
|
|
|
private @Nullable String source;
|
|
|
|
public BalanceSnapshotEntry() {
|
|
super();
|
|
}
|
|
|
|
/**
|
|
* Constructor with only required parameters
|
|
*/
|
|
public BalanceSnapshotEntry(String snapshotId, String resourceType, BigDecimal balance, OffsetDateTime capturedAt) {
|
|
this.snapshotId = snapshotId;
|
|
this.resourceType = resourceType;
|
|
this.balance = balance;
|
|
this.capturedAt = capturedAt;
|
|
}
|
|
|
|
public BalanceSnapshotEntry snapshotId(String snapshotId) {
|
|
this.snapshotId = snapshotId;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* 快照 ID
|
|
* @return snapshotId
|
|
*/
|
|
@NotNull
|
|
@Schema(name = "snapshotId", description = "快照 ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
|
@JsonProperty("snapshotId")
|
|
public String getSnapshotId() {
|
|
return snapshotId;
|
|
}
|
|
|
|
@JsonProperty("snapshotId")
|
|
public void setSnapshotId(String snapshotId) {
|
|
this.snapshotId = snapshotId;
|
|
}
|
|
|
|
public BalanceSnapshotEntry 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 BalanceSnapshotEntry balance(BigDecimal balance) {
|
|
this.balance = balance;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* 余额(不暴露供应商路由或成本策略)
|
|
* @return balance
|
|
*/
|
|
@NotNull @Valid
|
|
@Schema(name = "balance", description = "余额(不暴露供应商路由或成本策略)", requiredMode = Schema.RequiredMode.REQUIRED)
|
|
@JsonProperty("balance")
|
|
public BigDecimal getBalance() {
|
|
return balance;
|
|
}
|
|
|
|
@JsonProperty("balance")
|
|
public void setBalance(BigDecimal balance) {
|
|
this.balance = balance;
|
|
}
|
|
|
|
public BalanceSnapshotEntry usedQuota(@Nullable Integer usedQuota) {
|
|
this.usedQuota = usedQuota;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* 已使用配额
|
|
* @return usedQuota
|
|
*/
|
|
|
|
@Schema(name = "usedQuota", description = "已使用配额", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
|
@JsonProperty("usedQuota")
|
|
public @Nullable Integer getUsedQuota() {
|
|
return usedQuota;
|
|
}
|
|
|
|
@JsonProperty("usedQuota")
|
|
public void setUsedQuota(@Nullable Integer usedQuota) {
|
|
this.usedQuota = usedQuota;
|
|
}
|
|
|
|
public BalanceSnapshotEntry totalQuota(@Nullable Integer totalQuota) {
|
|
this.totalQuota = totalQuota;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* 总配额
|
|
* @return totalQuota
|
|
*/
|
|
|
|
@Schema(name = "totalQuota", description = "总配额", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
|
@JsonProperty("totalQuota")
|
|
public @Nullable Integer getTotalQuota() {
|
|
return totalQuota;
|
|
}
|
|
|
|
@JsonProperty("totalQuota")
|
|
public void setTotalQuota(@Nullable Integer totalQuota) {
|
|
this.totalQuota = totalQuota;
|
|
}
|
|
|
|
public BalanceSnapshotEntry expiresAt(@Nullable OffsetDateTime expiresAt) {
|
|
this.expiresAt = expiresAt;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* 到期时间
|
|
* @return expiresAt
|
|
*/
|
|
@Valid
|
|
@Schema(name = "expiresAt", description = "到期时间", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
|
@JsonProperty("expiresAt")
|
|
public @Nullable OffsetDateTime getExpiresAt() {
|
|
return expiresAt;
|
|
}
|
|
|
|
@JsonProperty("expiresAt")
|
|
public void setExpiresAt(@Nullable OffsetDateTime expiresAt) {
|
|
this.expiresAt = expiresAt;
|
|
}
|
|
|
|
public BalanceSnapshotEntry capturedAt(OffsetDateTime capturedAt) {
|
|
this.capturedAt = capturedAt;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* 快照捕获时间
|
|
* @return capturedAt
|
|
*/
|
|
@NotNull @Valid
|
|
@Schema(name = "capturedAt", description = "快照捕获时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
|
@JsonProperty("capturedAt")
|
|
public OffsetDateTime getCapturedAt() {
|
|
return capturedAt;
|
|
}
|
|
|
|
@JsonProperty("capturedAt")
|
|
public void setCapturedAt(OffsetDateTime capturedAt) {
|
|
this.capturedAt = capturedAt;
|
|
}
|
|
|
|
public BalanceSnapshotEntry source(@Nullable String source) {
|
|
this.source = source;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* 快照来源(套餐/管理员/市场补偿等)
|
|
* @return source
|
|
*/
|
|
|
|
@Schema(name = "source", description = "快照来源(套餐/管理员/市场补偿等)", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
|
@JsonProperty("source")
|
|
public @Nullable String getSource() {
|
|
return source;
|
|
}
|
|
|
|
@JsonProperty("source")
|
|
public void setSource(@Nullable String source) {
|
|
this.source = source;
|
|
}
|
|
|
|
@Override
|
|
public boolean equals(Object o) {
|
|
if (this == o) {
|
|
return true;
|
|
}
|
|
if (o == null || getClass() != o.getClass()) {
|
|
return false;
|
|
}
|
|
BalanceSnapshotEntry balanceSnapshotEntry = (BalanceSnapshotEntry) o;
|
|
return Objects.equals(this.snapshotId, balanceSnapshotEntry.snapshotId) &&
|
|
Objects.equals(this.resourceType, balanceSnapshotEntry.resourceType) &&
|
|
Objects.equals(this.balance, balanceSnapshotEntry.balance) &&
|
|
Objects.equals(this.usedQuota, balanceSnapshotEntry.usedQuota) &&
|
|
Objects.equals(this.totalQuota, balanceSnapshotEntry.totalQuota) &&
|
|
Objects.equals(this.expiresAt, balanceSnapshotEntry.expiresAt) &&
|
|
Objects.equals(this.capturedAt, balanceSnapshotEntry.capturedAt) &&
|
|
Objects.equals(this.source, balanceSnapshotEntry.source);
|
|
}
|
|
|
|
@Override
|
|
public int hashCode() {
|
|
return Objects.hash(snapshotId, resourceType, balance, usedQuota, totalQuota, expiresAt, capturedAt, source);
|
|
}
|
|
|
|
@Override
|
|
public String toString() {
|
|
StringBuilder sb = new StringBuilder();
|
|
sb.append("class BalanceSnapshotEntry {\n");
|
|
sb.append(" snapshotId: ").append(toIndentedString(snapshotId)).append("\n");
|
|
sb.append(" resourceType: ").append(toIndentedString(resourceType)).append("\n");
|
|
sb.append(" balance: ").append(toIndentedString(balance)).append("\n");
|
|
sb.append(" usedQuota: ").append(toIndentedString(usedQuota)).append("\n");
|
|
sb.append(" totalQuota: ").append(toIndentedString(totalQuota)).append("\n");
|
|
sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n");
|
|
sb.append(" capturedAt: ").append(toIndentedString(capturedAt)).append("\n");
|
|
sb.append(" source: ").append(toIndentedString(source)).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 ");
|
|
}
|
|
}
|
|
|