214 lines
5.5 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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 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;
/**
* Security facade 批准后的工具调用预算。
*/
@Schema(name = "ToolGrantBudget", description = "Security facade 批准后的工具调用预算。")
@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 ToolGrantBudget implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 预算周期
*/
public enum PeriodEnum {
PER_TASK("per_task"),
DAILY("daily"),
MONTHLY("monthly");
private final String value;
PeriodEnum(String value) {
this.value = value;
}
@JsonValue
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
@JsonCreator
public static PeriodEnum fromValue(String value) {
for (PeriodEnum b : PeriodEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
}
private PeriodEnum period;
private Integer maxCalls;
private @Nullable Integer maxTokens;
private @Nullable Integer maxCostCents;
public ToolGrantBudget() {
super();
}
/**
* Constructor with only required parameters
*/
public ToolGrantBudget(PeriodEnum period, Integer maxCalls) {
this.period = period;
this.maxCalls = maxCalls;
}
public ToolGrantBudget period(PeriodEnum period) {
this.period = period;
return this;
}
/**
* 预算周期
* @return period
*/
@NotNull
@Schema(name = "period", description = "预算周期", requiredMode = Schema.RequiredMode.REQUIRED)
@JsonProperty("period")
public PeriodEnum getPeriod() {
return period;
}
@JsonProperty("period")
public void setPeriod(PeriodEnum period) {
this.period = period;
}
public ToolGrantBudget maxCalls(Integer maxCalls) {
this.maxCalls = maxCalls;
return this;
}
/**
* 周期内最大调用次数
* minimum: 1
* @return maxCalls
*/
@NotNull @Min(value = 1)
@Schema(name = "maxCalls", description = "周期内最大调用次数", requiredMode = Schema.RequiredMode.REQUIRED)
@JsonProperty("maxCalls")
public Integer getMaxCalls() {
return maxCalls;
}
@JsonProperty("maxCalls")
public void setMaxCalls(Integer maxCalls) {
this.maxCalls = maxCalls;
}
public ToolGrantBudget maxTokens(@Nullable Integer maxTokens) {
this.maxTokens = maxTokens;
return this;
}
/**
* 周期内最大 token 用量0 表示该工具不消耗 token 预算。
* minimum: 0
* @return maxTokens
*/
@Min(value = 0)
@Schema(name = "maxTokens", description = "周期内最大 token 用量0 表示该工具不消耗 token 预算。", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("maxTokens")
public @Nullable Integer getMaxTokens() {
return maxTokens;
}
@JsonProperty("maxTokens")
public void setMaxTokens(@Nullable Integer maxTokens) {
this.maxTokens = maxTokens;
}
public ToolGrantBudget maxCostCents(@Nullable Integer maxCostCents) {
this.maxCostCents = maxCostCents;
return this;
}
/**
* 周期内最大成本,单位为分。
* minimum: 0
* @return maxCostCents
*/
@Min(value = 0)
@Schema(name = "maxCostCents", description = "周期内最大成本,单位为分。", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("maxCostCents")
public @Nullable Integer getMaxCostCents() {
return maxCostCents;
}
@JsonProperty("maxCostCents")
public void setMaxCostCents(@Nullable Integer maxCostCents) {
this.maxCostCents = maxCostCents;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ToolGrantBudget toolGrantBudget = (ToolGrantBudget) o;
return Objects.equals(this.period, toolGrantBudget.period) &&
Objects.equals(this.maxCalls, toolGrantBudget.maxCalls) &&
Objects.equals(this.maxTokens, toolGrantBudget.maxTokens) &&
Objects.equals(this.maxCostCents, toolGrantBudget.maxCostCents);
}
@Override
public int hashCode() {
return Objects.hash(period, maxCalls, maxTokens, maxCostCents);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ToolGrantBudget {\n");
sb.append(" period: ").append(toIndentedString(period)).append("\n");
sb.append(" maxCalls: ").append(toIndentedString(maxCalls)).append("\n");
sb.append(" maxTokens: ").append(toIndentedString(maxTokens)).append("\n");
sb.append(" maxCostCents: ").append(toIndentedString(maxCostCents)).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 ");
}
}