oh-my-muse/docs/api-contracts/generated/java/com/muse/dto/PublishDraftRequest.java

533 lines
15 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 java.net.URI;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.UUID;
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 = "PublishDraftRequest", 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 PublishDraftRequest implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 资产类型
*/
public enum AssetTypeEnum {
WORK("work"),
AGENT("agent"),
KNOWLEDGE_BASE("knowledge_base");
private final String value;
AssetTypeEnum(String value) {
this.value = value;
}
@JsonValue
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
@JsonCreator
public static AssetTypeEnum fromValue(String value) {
for (AssetTypeEnum b : AssetTypeEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
}
private AssetTypeEnum assetType;
private UUID sourceId;
private String name;
private @Nullable String summary;
private @Nullable String description;
private @Nullable UUID categoryId;
private @Nullable String licenseType;
@Valid
private List<String> allowedUses = new ArrayList<>();
@Valid
private List<String> prohibitedUses = new ArrayList<>();
private @Nullable URI coverImageUrl;
@Valid
private List<String> tags = new ArrayList<>();
private @Nullable String rightsDeclaration;
private @Nullable String externalOrderRef;
/**
* 作品资产发布模式。当前 gate 未完成,默认且唯一可直接开放的是 read_only_favorite_licensefull/reference/context_use 必须经后续 owner gate 和市场审核显式放开。
*/
public enum WorkAssetModeEnum {
READ_ONLY_FAVORITE_LICENSE("read_only_favorite_license"),
FULL("full"),
REFERENCE("reference"),
CONTEXT_USE("context_use");
private final String value;
WorkAssetModeEnum(String value) {
this.value = value;
}
@JsonValue
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
@JsonCreator
public static WorkAssetModeEnum fromValue(String value) {
for (WorkAssetModeEnum b : WorkAssetModeEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
}
private WorkAssetModeEnum workAssetMode = WorkAssetModeEnum.READ_ONLY_FAVORITE_LICENSE;
public PublishDraftRequest() {
super();
}
/**
* Constructor with only required parameters
*/
public PublishDraftRequest(AssetTypeEnum assetType, UUID sourceId, String name) {
this.assetType = assetType;
this.sourceId = sourceId;
this.name = name;
}
public PublishDraftRequest assetType(AssetTypeEnum assetType) {
this.assetType = assetType;
return this;
}
/**
* 资产类型
* @return assetType
*/
@NotNull
@Schema(name = "assetType", description = "资产类型", requiredMode = Schema.RequiredMode.REQUIRED)
@JsonProperty("assetType")
public AssetTypeEnum getAssetType() {
return assetType;
}
@JsonProperty("assetType")
public void setAssetType(AssetTypeEnum assetType) {
this.assetType = assetType;
}
public PublishDraftRequest sourceId(UUID sourceId) {
this.sourceId = sourceId;
return this;
}
/**
* 来源对象 ID作品/智能体/知识库)
* @return sourceId
*/
@NotNull @Valid
@Schema(name = "sourceId", description = "来源对象 ID作品/智能体/知识库)", requiredMode = Schema.RequiredMode.REQUIRED)
@JsonProperty("sourceId")
public UUID getSourceId() {
return sourceId;
}
@JsonProperty("sourceId")
public void setSourceId(UUID sourceId) {
this.sourceId = sourceId;
}
public PublishDraftRequest name(String name) {
this.name = name;
return this;
}
/**
* 市场展示标题
* @return name
*/
@NotNull @Size(max = 200)
@Schema(name = "name", description = "市场展示标题", requiredMode = Schema.RequiredMode.REQUIRED)
@JsonProperty("name")
public String getName() {
return name;
}
@JsonProperty("name")
public void setName(String name) {
this.name = name;
}
public PublishDraftRequest summary(@Nullable String summary) {
this.summary = summary;
return this;
}
/**
* 市场展示摘要
* @return summary
*/
@Size(max = 500)
@Schema(name = "summary", description = "市场展示摘要", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("summary")
public @Nullable String getSummary() {
return summary;
}
@JsonProperty("summary")
public void setSummary(@Nullable String summary) {
this.summary = summary;
}
public PublishDraftRequest description(@Nullable String description) {
this.description = description;
return this;
}
/**
* Get description
* @return description
*/
@Size(max = 5000)
@Schema(name = "description", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("description")
public @Nullable String getDescription() {
return description;
}
@JsonProperty("description")
public void setDescription(@Nullable String description) {
this.description = description;
}
public PublishDraftRequest categoryId(@Nullable UUID categoryId) {
this.categoryId = categoryId;
return this;
}
/**
* Get categoryId
* @return categoryId
*/
@Valid
@Schema(name = "categoryId", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("categoryId")
public @Nullable UUID getCategoryId() {
return categoryId;
}
@JsonProperty("categoryId")
public void setCategoryId(@Nullable UUID categoryId) {
this.categoryId = categoryId;
}
public PublishDraftRequest licenseType(@Nullable String licenseType) {
this.licenseType = licenseType;
return this;
}
/**
* 许可类型
* @return licenseType
*/
@Schema(name = "licenseType", description = "许可类型", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("licenseType")
public @Nullable String getLicenseType() {
return licenseType;
}
@JsonProperty("licenseType")
public void setLicenseType(@Nullable String licenseType) {
this.licenseType = licenseType;
}
public PublishDraftRequest allowedUses(List<String> allowedUses) {
this.allowedUses = allowedUses;
return this;
}
public PublishDraftRequest addAllowedUsesItem(String allowedUsesItem) {
if (this.allowedUses == null) {
this.allowedUses = new ArrayList<>();
}
this.allowedUses.add(allowedUsesItem);
return this;
}
/**
* Get allowedUses
* @return allowedUses
*/
@Schema(name = "allowedUses", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("allowedUses")
public List<String> getAllowedUses() {
return allowedUses;
}
@JsonProperty("allowedUses")
public void setAllowedUses(List<String> allowedUses) {
this.allowedUses = allowedUses;
}
public PublishDraftRequest prohibitedUses(List<String> prohibitedUses) {
this.prohibitedUses = prohibitedUses;
return this;
}
public PublishDraftRequest addProhibitedUsesItem(String prohibitedUsesItem) {
if (this.prohibitedUses == null) {
this.prohibitedUses = new ArrayList<>();
}
this.prohibitedUses.add(prohibitedUsesItem);
return this;
}
/**
* Get prohibitedUses
* @return prohibitedUses
*/
@Schema(name = "prohibitedUses", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("prohibitedUses")
public List<String> getProhibitedUses() {
return prohibitedUses;
}
@JsonProperty("prohibitedUses")
public void setProhibitedUses(List<String> prohibitedUses) {
this.prohibitedUses = prohibitedUses;
}
public PublishDraftRequest coverImageUrl(@Nullable URI coverImageUrl) {
this.coverImageUrl = coverImageUrl;
return this;
}
/**
* Get coverImageUrl
* @return coverImageUrl
*/
@Valid
@Schema(name = "coverImageUrl", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("coverImageUrl")
public @Nullable URI getCoverImageUrl() {
return coverImageUrl;
}
@JsonProperty("coverImageUrl")
public void setCoverImageUrl(@Nullable URI coverImageUrl) {
this.coverImageUrl = coverImageUrl;
}
public PublishDraftRequest tags(List<String> tags) {
this.tags = tags;
return this;
}
public PublishDraftRequest addTagsItem(String tagsItem) {
if (this.tags == null) {
this.tags = new ArrayList<>();
}
this.tags.add(tagsItem);
return this;
}
/**
* Get tags
* @return tags
*/
@Schema(name = "tags", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("tags")
public List<String> getTags() {
return tags;
}
@JsonProperty("tags")
public void setTags(List<String> tags) {
this.tags = tags;
}
public PublishDraftRequest rightsDeclaration(@Nullable String rightsDeclaration) {
this.rightsDeclaration = rightsDeclaration;
return this;
}
/**
* 权利声明
* @return rightsDeclaration
*/
@Schema(name = "rightsDeclaration", description = "权利声明", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("rightsDeclaration")
public @Nullable String getRightsDeclaration() {
return rightsDeclaration;
}
@JsonProperty("rightsDeclaration")
public void setRightsDeclaration(@Nullable String rightsDeclaration) {
this.rightsDeclaration = rightsDeclaration;
}
public PublishDraftRequest externalOrderRef(@Nullable String externalOrderRef) {
this.externalOrderRef = externalOrderRef;
return this;
}
/**
* 外部订单引用规则
* @return externalOrderRef
*/
@Schema(name = "externalOrderRef", description = "外部订单引用规则", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("externalOrderRef")
public @Nullable String getExternalOrderRef() {
return externalOrderRef;
}
@JsonProperty("externalOrderRef")
public void setExternalOrderRef(@Nullable String externalOrderRef) {
this.externalOrderRef = externalOrderRef;
}
public PublishDraftRequest workAssetMode(WorkAssetModeEnum workAssetMode) {
this.workAssetMode = workAssetMode;
return this;
}
/**
* 作品资产发布模式。当前 gate 未完成,默认且唯一可直接开放的是 read_only_favorite_licensefull/reference/context_use 必须经后续 owner gate 和市场审核显式放开。
* @return workAssetMode
*/
@Schema(name = "workAssetMode", description = "作品资产发布模式。当前 gate 未完成,默认且唯一可直接开放的是 read_only_favorite_licensefull/reference/context_use 必须经后续 owner gate 和市场审核显式放开。", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("workAssetMode")
public WorkAssetModeEnum getWorkAssetMode() {
return workAssetMode;
}
@JsonProperty("workAssetMode")
public void setWorkAssetMode(WorkAssetModeEnum workAssetMode) {
this.workAssetMode = workAssetMode;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
PublishDraftRequest publishDraftRequest = (PublishDraftRequest) o;
return Objects.equals(this.assetType, publishDraftRequest.assetType) &&
Objects.equals(this.sourceId, publishDraftRequest.sourceId) &&
Objects.equals(this.name, publishDraftRequest.name) &&
Objects.equals(this.summary, publishDraftRequest.summary) &&
Objects.equals(this.description, publishDraftRequest.description) &&
Objects.equals(this.categoryId, publishDraftRequest.categoryId) &&
Objects.equals(this.licenseType, publishDraftRequest.licenseType) &&
Objects.equals(this.allowedUses, publishDraftRequest.allowedUses) &&
Objects.equals(this.prohibitedUses, publishDraftRequest.prohibitedUses) &&
Objects.equals(this.coverImageUrl, publishDraftRequest.coverImageUrl) &&
Objects.equals(this.tags, publishDraftRequest.tags) &&
Objects.equals(this.rightsDeclaration, publishDraftRequest.rightsDeclaration) &&
Objects.equals(this.externalOrderRef, publishDraftRequest.externalOrderRef) &&
Objects.equals(this.workAssetMode, publishDraftRequest.workAssetMode);
}
@Override
public int hashCode() {
return Objects.hash(assetType, sourceId, name, summary, description, categoryId, licenseType, allowedUses, prohibitedUses, coverImageUrl, tags, rightsDeclaration, externalOrderRef, workAssetMode);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class PublishDraftRequest {\n");
sb.append(" assetType: ").append(toIndentedString(assetType)).append("\n");
sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" summary: ").append(toIndentedString(summary)).append("\n");
sb.append(" description: ").append(toIndentedString(description)).append("\n");
sb.append(" categoryId: ").append(toIndentedString(categoryId)).append("\n");
sb.append(" licenseType: ").append(toIndentedString(licenseType)).append("\n");
sb.append(" allowedUses: ").append(toIndentedString(allowedUses)).append("\n");
sb.append(" prohibitedUses: ").append(toIndentedString(prohibitedUses)).append("\n");
sb.append(" coverImageUrl: ").append(toIndentedString(coverImageUrl)).append("\n");
sb.append(" tags: ").append(toIndentedString(tags)).append("\n");
sb.append(" rightsDeclaration: ").append(toIndentedString(rightsDeclaration)).append("\n");
sb.append(" externalOrderRef: ").append(toIndentedString(externalOrderRef)).append("\n");
sb.append(" workAssetMode: ").append(toIndentedString(workAssetMode)).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 ");
}
}