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.muse.dto.AppUsageSummaryByAttributionInner; import com.muse.dto.AppUsageSummaryByDateInner; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; 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 = "AppUsageSummary", 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 AppUsageSummary implements Serializable { private static final long serialVersionUID = 1L; private @Nullable String period; private @Nullable Integer totalInputTokens; private @Nullable Integer totalOutputTokens; private @Nullable Integer pendingAttributionCount; private @Nullable Integer anomalyCount; @Valid private Map byModel = new HashMap<>(); @Valid private List<@Valid AppUsageSummaryByDateInner> byDate = new ArrayList<>(); @Valid private List<@Valid AppUsageSummaryByAttributionInner> byAttribution = new ArrayList<>(); public AppUsageSummary period(@Nullable String period) { this.period = period; return this; } /** * 统计周期 * @return period */ @Schema(name = "period", description = "统计周期", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("period") public @Nullable String getPeriod() { return period; } @JsonProperty("period") public void setPeriod(@Nullable String period) { this.period = period; } public AppUsageSummary totalInputTokens(@Nullable Integer totalInputTokens) { this.totalInputTokens = totalInputTokens; return this; } /** * 总输入 Token 数 * @return totalInputTokens */ @Schema(name = "totalInputTokens", description = "总输入 Token 数", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("totalInputTokens") public @Nullable Integer getTotalInputTokens() { return totalInputTokens; } @JsonProperty("totalInputTokens") public void setTotalInputTokens(@Nullable Integer totalInputTokens) { this.totalInputTokens = totalInputTokens; } public AppUsageSummary totalOutputTokens(@Nullable Integer totalOutputTokens) { this.totalOutputTokens = totalOutputTokens; return this; } /** * 总输出 Token 数 * @return totalOutputTokens */ @Schema(name = "totalOutputTokens", description = "总输出 Token 数", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("totalOutputTokens") public @Nullable Integer getTotalOutputTokens() { return totalOutputTokens; } @JsonProperty("totalOutputTokens") public void setTotalOutputTokens(@Nullable Integer totalOutputTokens) { this.totalOutputTokens = totalOutputTokens; } public AppUsageSummary pendingAttributionCount(@Nullable Integer pendingAttributionCount) { this.pendingAttributionCount = pendingAttributionCount; return this; } /** * 待归属记录数 * @return pendingAttributionCount */ @Schema(name = "pendingAttributionCount", description = "待归属记录数", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("pendingAttributionCount") public @Nullable Integer getPendingAttributionCount() { return pendingAttributionCount; } @JsonProperty("pendingAttributionCount") public void setPendingAttributionCount(@Nullable Integer pendingAttributionCount) { this.pendingAttributionCount = pendingAttributionCount; } public AppUsageSummary anomalyCount(@Nullable Integer anomalyCount) { this.anomalyCount = anomalyCount; return this; } /** * 计量异常记录数 * @return anomalyCount */ @Schema(name = "anomalyCount", description = "计量异常记录数", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("anomalyCount") public @Nullable Integer getAnomalyCount() { return anomalyCount; } @JsonProperty("anomalyCount") public void setAnomalyCount(@Nullable Integer anomalyCount) { this.anomalyCount = anomalyCount; } public AppUsageSummary byModel(Map byModel) { this.byModel = byModel; return this; } public AppUsageSummary putByModelItem(String key, Integer byModelItem) { if (this.byModel == null) { this.byModel = new HashMap<>(); } this.byModel.put(key, byModelItem); return this; } /** * 按模型的用量分布 * @return byModel */ @Schema(name = "byModel", description = "按模型的用量分布", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("byModel") public Map getByModel() { return byModel; } @JsonProperty("byModel") public void setByModel(Map byModel) { this.byModel = byModel; } public AppUsageSummary byDate(List<@Valid AppUsageSummaryByDateInner> byDate) { this.byDate = byDate; return this; } public AppUsageSummary addByDateItem(AppUsageSummaryByDateInner byDateItem) { if (this.byDate == null) { this.byDate = new ArrayList<>(); } this.byDate.add(byDateItem); return this; } /** * 按日期的用量分布 * @return byDate */ @Valid @Schema(name = "byDate", description = "按日期的用量分布", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("byDate") public List<@Valid AppUsageSummaryByDateInner> getByDate() { return byDate; } @JsonProperty("byDate") public void setByDate(List<@Valid AppUsageSummaryByDateInner> byDate) { this.byDate = byDate; } public AppUsageSummary byAttribution(List<@Valid AppUsageSummaryByAttributionInner> byAttribution) { this.byAttribution = byAttribution; return this; } public AppUsageSummary addByAttributionItem(AppUsageSummaryByAttributionInner byAttributionItem) { if (this.byAttribution == null) { this.byAttribution = new ArrayList<>(); } this.byAttribution.add(byAttributionItem); return this; } /** * 按归属对象类型的用量分布 * @return byAttribution */ @Valid @Schema(name = "byAttribution", description = "按归属对象类型的用量分布", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("byAttribution") public List<@Valid AppUsageSummaryByAttributionInner> getByAttribution() { return byAttribution; } @JsonProperty("byAttribution") public void setByAttribution(List<@Valid AppUsageSummaryByAttributionInner> byAttribution) { this.byAttribution = byAttribution; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } AppUsageSummary appUsageSummary = (AppUsageSummary) o; return Objects.equals(this.period, appUsageSummary.period) && Objects.equals(this.totalInputTokens, appUsageSummary.totalInputTokens) && Objects.equals(this.totalOutputTokens, appUsageSummary.totalOutputTokens) && Objects.equals(this.pendingAttributionCount, appUsageSummary.pendingAttributionCount) && Objects.equals(this.anomalyCount, appUsageSummary.anomalyCount) && Objects.equals(this.byModel, appUsageSummary.byModel) && Objects.equals(this.byDate, appUsageSummary.byDate) && Objects.equals(this.byAttribution, appUsageSummary.byAttribution); } @Override public int hashCode() { return Objects.hash(period, totalInputTokens, totalOutputTokens, pendingAttributionCount, anomalyCount, byModel, byDate, byAttribution); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class AppUsageSummary {\n"); sb.append(" period: ").append(toIndentedString(period)).append("\n"); sb.append(" totalInputTokens: ").append(toIndentedString(totalInputTokens)).append("\n"); sb.append(" totalOutputTokens: ").append(toIndentedString(totalOutputTokens)).append("\n"); sb.append(" pendingAttributionCount: ").append(toIndentedString(pendingAttributionCount)).append("\n"); sb.append(" anomalyCount: ").append(toIndentedString(anomalyCount)).append("\n"); sb.append(" byModel: ").append(toIndentedString(byModel)).append("\n"); sb.append(" byDate: ").append(toIndentedString(byDate)).append("\n"); sb.append(" byAttribution: ").append(toIndentedString(byAttribution)).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 "); } }