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.JsonTypeName; 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; /** * PublishAssetRequest */ @JsonTypeName("publishAsset_request") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2026-05-24T14:16:55.032756+08:00[Asia/Shanghai]", comments = "Generator version: 7.22.0") public class PublishAssetRequest implements Serializable { private static final long serialVersionUID = 1L; private String name; private @Nullable String description; /** * Gets or Sets type */ public enum TypeEnum { AGENT("agent"), PROMPT_TEMPLATE("prompt_template"), KNOWLEDGE_SOURCE("knowledge_source"), METASCHEMA("metaschema"); private final String value; TypeEnum(String value) { this.value = value; } @JsonValue public String getValue() { return value; } @Override public String toString() { return String.valueOf(value); } @JsonCreator public static TypeEnum fromValue(String value) { for (TypeEnum b : TypeEnum.values()) { if (b.value.equals(value)) { return b; } } throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } private TypeEnum type; private UUID sourceId; @Valid private List tags = new ArrayList<>(); private @Nullable URI coverImageUrl; public PublishAssetRequest() { super(); } /** * Constructor with only required parameters */ public PublishAssetRequest(String name, TypeEnum type, UUID sourceId) { this.name = name; this.type = type; this.sourceId = sourceId; } public PublishAssetRequest name(String name) { this.name = name; return this; } /** * Get name * @return name */ @NotNull @Size(max = 200) @Schema(name = "name", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("name") public String getName() { return name; } @JsonProperty("name") public void setName(String name) { this.name = name; } public PublishAssetRequest 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 PublishAssetRequest type(TypeEnum type) { this.type = type; return this; } /** * Get type * @return type */ @NotNull @Schema(name = "type", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("type") public TypeEnum getType() { return type; } @JsonProperty("type") public void setType(TypeEnum type) { this.type = type; } public PublishAssetRequest 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 PublishAssetRequest tags(List tags) { this.tags = tags; return this; } public PublishAssetRequest 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 getTags() { return tags; } @JsonProperty("tags") public void setTags(List tags) { this.tags = tags; } public PublishAssetRequest 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; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } PublishAssetRequest publishAssetRequest = (PublishAssetRequest) o; return Objects.equals(this.name, publishAssetRequest.name) && Objects.equals(this.description, publishAssetRequest.description) && Objects.equals(this.type, publishAssetRequest.type) && Objects.equals(this.sourceId, publishAssetRequest.sourceId) && Objects.equals(this.tags, publishAssetRequest.tags) && Objects.equals(this.coverImageUrl, publishAssetRequest.coverImageUrl); } @Override public int hashCode() { return Objects.hash(name, description, type, sourceId, tags, coverImageUrl); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class PublishAssetRequest {\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" description: ").append(toIndentedString(description)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); sb.append(" coverImageUrl: ").append(toIndentedString(coverImageUrl)).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 "); } }