285 lines
8.6 KiB
Java
285 lines
8.6 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 com.muse.dto.AppEntitlementDetailPublishCapability;
|
|
import com.muse.dto.AppEntitlementDetailRateLimitsInner;
|
|
import com.muse.dto.Entitlement;
|
|
import com.muse.dto.Quota;
|
|
import java.time.OffsetDateTime;
|
|
import java.util.ArrayList;
|
|
import java.util.Arrays;
|
|
import java.util.List;
|
|
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 = "AppEntitlementDetail", 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 AppEntitlementDetail implements Serializable {
|
|
|
|
private static final long serialVersionUID = 1L;
|
|
|
|
private @Nullable String planName;
|
|
|
|
private @Nullable String entitlementSource;
|
|
|
|
@Valid
|
|
private List<@Valid Entitlement> entitlements = new ArrayList<>();
|
|
|
|
@Valid
|
|
private List<@Valid Quota> quotas = new ArrayList<>();
|
|
|
|
@Valid
|
|
private List<@Valid AppEntitlementDetailRateLimitsInner> rateLimits = new ArrayList<>();
|
|
|
|
private @Nullable AppEntitlementDetailPublishCapability publishCapability;
|
|
|
|
@DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
|
|
private @Nullable OffsetDateTime expiresAt;
|
|
|
|
public AppEntitlementDetail() {
|
|
super();
|
|
}
|
|
|
|
/**
|
|
* Constructor with only required parameters
|
|
*/
|
|
public AppEntitlementDetail(List<@Valid Entitlement> entitlements, List<@Valid Quota> quotas) {
|
|
this.entitlements = entitlements;
|
|
this.quotas = quotas;
|
|
}
|
|
|
|
public AppEntitlementDetail planName(@Nullable String planName) {
|
|
this.planName = planName;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* 当前套餐名
|
|
* @return planName
|
|
*/
|
|
|
|
@Schema(name = "planName", description = "当前套餐名", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
|
@JsonProperty("planName")
|
|
public @Nullable String getPlanName() {
|
|
return planName;
|
|
}
|
|
|
|
@JsonProperty("planName")
|
|
public void setPlanName(@Nullable String planName) {
|
|
this.planName = planName;
|
|
}
|
|
|
|
public AppEntitlementDetail entitlementSource(@Nullable String entitlementSource) {
|
|
this.entitlementSource = entitlementSource;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* 权益来源说明
|
|
* @return entitlementSource
|
|
*/
|
|
|
|
@Schema(name = "entitlementSource", description = "权益来源说明", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
|
@JsonProperty("entitlementSource")
|
|
public @Nullable String getEntitlementSource() {
|
|
return entitlementSource;
|
|
}
|
|
|
|
@JsonProperty("entitlementSource")
|
|
public void setEntitlementSource(@Nullable String entitlementSource) {
|
|
this.entitlementSource = entitlementSource;
|
|
}
|
|
|
|
public AppEntitlementDetail entitlements(List<@Valid Entitlement> entitlements) {
|
|
this.entitlements = entitlements;
|
|
return this;
|
|
}
|
|
|
|
public AppEntitlementDetail addEntitlementsItem(Entitlement entitlementsItem) {
|
|
if (this.entitlements == null) {
|
|
this.entitlements = new ArrayList<>();
|
|
}
|
|
this.entitlements.add(entitlementsItem);
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* 权益列表
|
|
* @return entitlements
|
|
*/
|
|
@NotNull @Valid
|
|
@Schema(name = "entitlements", description = "权益列表", requiredMode = Schema.RequiredMode.REQUIRED)
|
|
@JsonProperty("entitlements")
|
|
public List<@Valid Entitlement> getEntitlements() {
|
|
return entitlements;
|
|
}
|
|
|
|
@JsonProperty("entitlements")
|
|
public void setEntitlements(List<@Valid Entitlement> entitlements) {
|
|
this.entitlements = entitlements;
|
|
}
|
|
|
|
public AppEntitlementDetail quotas(List<@Valid Quota> quotas) {
|
|
this.quotas = quotas;
|
|
return this;
|
|
}
|
|
|
|
public AppEntitlementDetail addQuotasItem(Quota quotasItem) {
|
|
if (this.quotas == null) {
|
|
this.quotas = new ArrayList<>();
|
|
}
|
|
this.quotas.add(quotasItem);
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* 配额列表
|
|
* @return quotas
|
|
*/
|
|
@NotNull @Valid
|
|
@Schema(name = "quotas", description = "配额列表", requiredMode = Schema.RequiredMode.REQUIRED)
|
|
@JsonProperty("quotas")
|
|
public List<@Valid Quota> getQuotas() {
|
|
return quotas;
|
|
}
|
|
|
|
@JsonProperty("quotas")
|
|
public void setQuotas(List<@Valid Quota> quotas) {
|
|
this.quotas = quotas;
|
|
}
|
|
|
|
public AppEntitlementDetail rateLimits(List<@Valid AppEntitlementDetailRateLimitsInner> rateLimits) {
|
|
this.rateLimits = rateLimits;
|
|
return this;
|
|
}
|
|
|
|
public AppEntitlementDetail addRateLimitsItem(AppEntitlementDetailRateLimitsInner rateLimitsItem) {
|
|
if (this.rateLimits == null) {
|
|
this.rateLimits = new ArrayList<>();
|
|
}
|
|
this.rateLimits.add(rateLimitsItem);
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* 限流信息
|
|
* @return rateLimits
|
|
*/
|
|
@Valid
|
|
@Schema(name = "rateLimits", description = "限流信息", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
|
@JsonProperty("rateLimits")
|
|
public List<@Valid AppEntitlementDetailRateLimitsInner> getRateLimits() {
|
|
return rateLimits;
|
|
}
|
|
|
|
@JsonProperty("rateLimits")
|
|
public void setRateLimits(List<@Valid AppEntitlementDetailRateLimitsInner> rateLimits) {
|
|
this.rateLimits = rateLimits;
|
|
}
|
|
|
|
public AppEntitlementDetail publishCapability(@Nullable AppEntitlementDetailPublishCapability publishCapability) {
|
|
this.publishCapability = publishCapability;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* Get publishCapability
|
|
* @return publishCapability
|
|
*/
|
|
@Valid
|
|
@Schema(name = "publishCapability", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
|
@JsonProperty("publishCapability")
|
|
public @Nullable AppEntitlementDetailPublishCapability getPublishCapability() {
|
|
return publishCapability;
|
|
}
|
|
|
|
@JsonProperty("publishCapability")
|
|
public void setPublishCapability(@Nullable AppEntitlementDetailPublishCapability publishCapability) {
|
|
this.publishCapability = publishCapability;
|
|
}
|
|
|
|
public AppEntitlementDetail 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;
|
|
}
|
|
|
|
@Override
|
|
public boolean equals(Object o) {
|
|
if (this == o) {
|
|
return true;
|
|
}
|
|
if (o == null || getClass() != o.getClass()) {
|
|
return false;
|
|
}
|
|
AppEntitlementDetail appEntitlementDetail = (AppEntitlementDetail) o;
|
|
return Objects.equals(this.planName, appEntitlementDetail.planName) &&
|
|
Objects.equals(this.entitlementSource, appEntitlementDetail.entitlementSource) &&
|
|
Objects.equals(this.entitlements, appEntitlementDetail.entitlements) &&
|
|
Objects.equals(this.quotas, appEntitlementDetail.quotas) &&
|
|
Objects.equals(this.rateLimits, appEntitlementDetail.rateLimits) &&
|
|
Objects.equals(this.publishCapability, appEntitlementDetail.publishCapability) &&
|
|
Objects.equals(this.expiresAt, appEntitlementDetail.expiresAt);
|
|
}
|
|
|
|
@Override
|
|
public int hashCode() {
|
|
return Objects.hash(planName, entitlementSource, entitlements, quotas, rateLimits, publishCapability, expiresAt);
|
|
}
|
|
|
|
@Override
|
|
public String toString() {
|
|
StringBuilder sb = new StringBuilder();
|
|
sb.append("class AppEntitlementDetail {\n");
|
|
sb.append(" planName: ").append(toIndentedString(planName)).append("\n");
|
|
sb.append(" entitlementSource: ").append(toIndentedString(entitlementSource)).append("\n");
|
|
sb.append(" entitlements: ").append(toIndentedString(entitlements)).append("\n");
|
|
sb.append(" quotas: ").append(toIndentedString(quotas)).append("\n");
|
|
sb.append(" rateLimits: ").append(toIndentedString(rateLimits)).append("\n");
|
|
sb.append(" publishCapability: ").append(toIndentedString(publishCapability)).append("\n");
|
|
sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).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 ");
|
|
}
|
|
}
|
|
|