254 lines
6.4 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.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 = "Quota", 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 Quota implements Serializable {
private static final long serialVersionUID = 1L;
private String id;
private String resourceType;
private Integer total;
private @Nullable Integer used;
private Integer remaining;
@DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
private OffsetDateTime resetAt;
private @Nullable Integer limitPerMinute;
public Quota() {
super();
}
/**
* Constructor with only required parameters
*/
public Quota(String id, String resourceType, Integer total, Integer remaining, OffsetDateTime resetAt) {
this.id = id;
this.resourceType = resourceType;
this.total = total;
this.remaining = remaining;
this.resetAt = resetAt;
}
public Quota id(String id) {
this.id = id;
return this;
}
/**
* 配额 ID
* @return id
*/
@NotNull
@Schema(name = "id", description = "配额 ID", requiredMode = Schema.RequiredMode.REQUIRED)
@JsonProperty("id")
public String getId() {
return id;
}
@JsonProperty("id")
public void setId(String id) {
this.id = id;
}
public Quota 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 Quota total(Integer total) {
this.total = total;
return this;
}
/**
* 总配额
* @return total
*/
@NotNull
@Schema(name = "total", description = "总配额", requiredMode = Schema.RequiredMode.REQUIRED)
@JsonProperty("total")
public Integer getTotal() {
return total;
}
@JsonProperty("total")
public void setTotal(Integer total) {
this.total = total;
}
public Quota used(@Nullable Integer used) {
this.used = used;
return this;
}
/**
* 已使用量
* @return used
*/
@Schema(name = "used", description = "已使用量", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("used")
public @Nullable Integer getUsed() {
return used;
}
@JsonProperty("used")
public void setUsed(@Nullable Integer used) {
this.used = used;
}
public Quota remaining(Integer remaining) {
this.remaining = remaining;
return this;
}
/**
* 剩余配额
* @return remaining
*/
@NotNull
@Schema(name = "remaining", description = "剩余配额", requiredMode = Schema.RequiredMode.REQUIRED)
@JsonProperty("remaining")
public Integer getRemaining() {
return remaining;
}
@JsonProperty("remaining")
public void setRemaining(Integer remaining) {
this.remaining = remaining;
}
public Quota resetAt(OffsetDateTime resetAt) {
this.resetAt = resetAt;
return this;
}
/**
* 配额重置时间
* @return resetAt
*/
@NotNull @Valid
@Schema(name = "resetAt", description = "配额重置时间", requiredMode = Schema.RequiredMode.REQUIRED)
@JsonProperty("resetAt")
public OffsetDateTime getResetAt() {
return resetAt;
}
@JsonProperty("resetAt")
public void setResetAt(OffsetDateTime resetAt) {
this.resetAt = resetAt;
}
public Quota limitPerMinute(@Nullable Integer limitPerMinute) {
this.limitPerMinute = limitPerMinute;
return this;
}
/**
* 频率限制(每分钟)
* @return limitPerMinute
*/
@Schema(name = "limitPerMinute", description = "频率限制(每分钟)", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("limitPerMinute")
public @Nullable Integer getLimitPerMinute() {
return limitPerMinute;
}
@JsonProperty("limitPerMinute")
public void setLimitPerMinute(@Nullable Integer limitPerMinute) {
this.limitPerMinute = limitPerMinute;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Quota quota = (Quota) o;
return Objects.equals(this.id, quota.id) &&
Objects.equals(this.resourceType, quota.resourceType) &&
Objects.equals(this.total, quota.total) &&
Objects.equals(this.used, quota.used) &&
Objects.equals(this.remaining, quota.remaining) &&
Objects.equals(this.resetAt, quota.resetAt) &&
Objects.equals(this.limitPerMinute, quota.limitPerMinute);
}
@Override
public int hashCode() {
return Objects.hash(id, resourceType, total, used, remaining, resetAt, limitPerMinute);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Quota {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" resourceType: ").append(toIndentedString(resourceType)).append("\n");
sb.append(" total: ").append(toIndentedString(total)).append("\n");
sb.append(" used: ").append(toIndentedString(used)).append("\n");
sb.append(" remaining: ").append(toIndentedString(remaining)).append("\n");
sb.append(" resetAt: ").append(toIndentedString(resetAt)).append("\n");
sb.append(" limitPerMinute: ").append(toIndentedString(limitPerMinute)).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 ");
}
}