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 com.muse.dto.AgentOverrideRef; import com.muse.dto.AiContextRef; import com.muse.dto.AiTaskIntent; 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; /** * 客户端只能提交任务意图、作品/章节/Block 上下文引用、agentSlotKey 或 agentOverrideRef。 服务端负责生成来源快照与 Runtime Permission Envelope;客户端不得提交上下文块数组、正文片段或授权快照。 */ @Schema(name = "CreateAiTaskRequest", description = "客户端只能提交任务意图、作品/章节/Block 上下文引用、agentSlotKey 或 agentOverrideRef。 服务端负责生成来源快照与 Runtime Permission Envelope;客户端不得提交上下文块数组、正文片段或授权快照。 ") @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 CreateAiTaskRequest implements Serializable { private static final long serialVersionUID = 1L; private String commandId; private AiTaskIntent intent; private @Nullable UUID workId; private @Nullable UUID blockId; private @Nullable UUID chapterId; private @Nullable String agentSlotKey; private @Nullable AgentOverrideRef agentOverrideRef; @Valid private List<@Valid AiContextRef> additionalContextRefs = new ArrayList<>(); /** * 服务端可读取的最大上下文范围;最终裁剪受 Runtime Permission Envelope 约束。 */ public enum ContextScopeEnum { NONE("none"), WORK("work"), CHAPTER("chapter"), BLOCK("block"); private final String value; ContextScopeEnum(String value) { this.value = value; } @JsonValue public String getValue() { return value; } @Override public String toString() { return String.valueOf(value); } @JsonCreator public static ContextScopeEnum fromValue(String value) { for (ContextScopeEnum b : ContextScopeEnum.values()) { if (b.value.equals(value)) { return b; } } throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } private ContextScopeEnum contextScope = ContextScopeEnum.WORK; public CreateAiTaskRequest() { super(); } /** * Constructor with only required parameters */ public CreateAiTaskRequest(String commandId, AiTaskIntent intent) { this.commandId = commandId; this.intent = intent; } public CreateAiTaskRequest commandId(String commandId) { this.commandId = commandId; return this; } /** * 幂等键 * @return commandId */ @NotNull @Schema(name = "commandId", description = "幂等键", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("commandId") public String getCommandId() { return commandId; } @JsonProperty("commandId") public void setCommandId(String commandId) { this.commandId = commandId; } public CreateAiTaskRequest intent(AiTaskIntent intent) { this.intent = intent; return this; } /** * Get intent * @return intent */ @NotNull @Valid @Schema(name = "intent", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("intent") public AiTaskIntent getIntent() { return intent; } @JsonProperty("intent") public void setIntent(AiTaskIntent intent) { this.intent = intent; } public CreateAiTaskRequest workId(@Nullable UUID workId) { this.workId = workId; return this; } /** * 目标作品 ID;服务端以此作为上下文和权限边界。 * @return workId */ @Valid @Schema(name = "workId", description = "目标作品 ID;服务端以此作为上下文和权限边界。", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("workId") public @Nullable UUID getWorkId() { return workId; } @JsonProperty("workId") public void setWorkId(@Nullable UUID workId) { this.workId = workId; } public CreateAiTaskRequest blockId(@Nullable UUID blockId) { this.blockId = blockId; return this; } /** * 目标 Block 引用(正文生成/续写等场景必填);服务端校验其归属 workId。 * @return blockId */ @Valid @Schema(name = "blockId", description = "目标 Block 引用(正文生成/续写等场景必填);服务端校验其归属 workId。", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("blockId") public @Nullable UUID getBlockId() { return blockId; } @JsonProperty("blockId") public void setBlockId(@Nullable UUID blockId) { this.blockId = blockId; } public CreateAiTaskRequest chapterId(@Nullable UUID chapterId) { this.chapterId = chapterId; return this; } /** * 目标章节引用;服务端校验其归属 workId。 * @return chapterId */ @Valid @Schema(name = "chapterId", description = "目标章节引用;服务端校验其归属 workId。", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("chapterId") public @Nullable UUID getChapterId() { return chapterId; } @JsonProperty("chapterId") public void setChapterId(@Nullable UUID chapterId) { this.chapterId = chapterId; } public CreateAiTaskRequest agentSlotKey(@Nullable String agentSlotKey) { this.agentSlotKey = agentSlotKey; return this; } /** * 作品内智能体槽位 key,由 Agent BC 解析为具体 Agent 版本。 * @return agentSlotKey */ @Schema(name = "agentSlotKey", description = "作品内智能体槽位 key,由 Agent BC 解析为具体 Agent 版本。", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("agentSlotKey") public @Nullable String getAgentSlotKey() { return agentSlotKey; } @JsonProperty("agentSlotKey") public void setAgentSlotKey(@Nullable String agentSlotKey) { this.agentSlotKey = agentSlotKey; } public CreateAiTaskRequest agentOverrideRef(@Nullable AgentOverrideRef agentOverrideRef) { this.agentOverrideRef = agentOverrideRef; return this; } /** * Get agentOverrideRef * @return agentOverrideRef */ @Valid @Schema(name = "agentOverrideRef", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("agentOverrideRef") public @Nullable AgentOverrideRef getAgentOverrideRef() { return agentOverrideRef; } @JsonProperty("agentOverrideRef") public void setAgentOverrideRef(@Nullable AgentOverrideRef agentOverrideRef) { this.agentOverrideRef = agentOverrideRef; } public CreateAiTaskRequest additionalContextRefs(List<@Valid AiContextRef> additionalContextRefs) { this.additionalContextRefs = additionalContextRefs; return this; } public CreateAiTaskRequest addAdditionalContextRefsItem(AiContextRef additionalContextRefsItem) { if (this.additionalContextRefs == null) { this.additionalContextRefs = new ArrayList<>(); } this.additionalContextRefs.add(additionalContextRefsItem); return this; } /** * 附加上下文引用;只能传 ID/revision,不能传正文或跨作品事实。 * @return additionalContextRefs */ @Valid @Schema(name = "additionalContextRefs", description = "附加上下文引用;只能传 ID/revision,不能传正文或跨作品事实。", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("additionalContextRefs") public List<@Valid AiContextRef> getAdditionalContextRefs() { return additionalContextRefs; } @JsonProperty("additionalContextRefs") public void setAdditionalContextRefs(List<@Valid AiContextRef> additionalContextRefs) { this.additionalContextRefs = additionalContextRefs; } public CreateAiTaskRequest contextScope(ContextScopeEnum contextScope) { this.contextScope = contextScope; return this; } /** * 服务端可读取的最大上下文范围;最终裁剪受 Runtime Permission Envelope 约束。 * @return contextScope */ @Schema(name = "contextScope", description = "服务端可读取的最大上下文范围;最终裁剪受 Runtime Permission Envelope 约束。", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("contextScope") public ContextScopeEnum getContextScope() { return contextScope; } @JsonProperty("contextScope") public void setContextScope(ContextScopeEnum contextScope) { this.contextScope = contextScope; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } CreateAiTaskRequest createAiTaskRequest = (CreateAiTaskRequest) o; return Objects.equals(this.commandId, createAiTaskRequest.commandId) && Objects.equals(this.intent, createAiTaskRequest.intent) && Objects.equals(this.workId, createAiTaskRequest.workId) && Objects.equals(this.blockId, createAiTaskRequest.blockId) && Objects.equals(this.chapterId, createAiTaskRequest.chapterId) && Objects.equals(this.agentSlotKey, createAiTaskRequest.agentSlotKey) && Objects.equals(this.agentOverrideRef, createAiTaskRequest.agentOverrideRef) && Objects.equals(this.additionalContextRefs, createAiTaskRequest.additionalContextRefs) && Objects.equals(this.contextScope, createAiTaskRequest.contextScope); } @Override public int hashCode() { return Objects.hash(commandId, intent, workId, blockId, chapterId, agentSlotKey, agentOverrideRef, additionalContextRefs, contextScope); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class CreateAiTaskRequest {\n"); sb.append(" commandId: ").append(toIndentedString(commandId)).append("\n"); sb.append(" intent: ").append(toIndentedString(intent)).append("\n"); sb.append(" workId: ").append(toIndentedString(workId)).append("\n"); sb.append(" blockId: ").append(toIndentedString(blockId)).append("\n"); sb.append(" chapterId: ").append(toIndentedString(chapterId)).append("\n"); sb.append(" agentSlotKey: ").append(toIndentedString(agentSlotKey)).append("\n"); sb.append(" agentOverrideRef: ").append(toIndentedString(agentOverrideRef)).append("\n"); sb.append(" additionalContextRefs: ").append(toIndentedString(additionalContextRefs)).append("\n"); sb.append(" contextScope: ").append(toIndentedString(contextScope)).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 "); } }