364 lines
11 KiB
Java
364 lines
11 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.fasterxml.jackson.annotation.JsonTypeName;
|
||
import com.fasterxml.jackson.annotation.JsonValue;
|
||
import com.muse.dto.ConfirmKnowledgeDraftRequestRiskAcknowledgement;
|
||
import java.util.HashMap;
|
||
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;
|
||
|
||
/**
|
||
* ConfirmKnowledgeDraftRequest
|
||
*/
|
||
|
||
@JsonTypeName("confirmKnowledgeDraft_request")
|
||
@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 ConfirmKnowledgeDraftRequest implements Serializable {
|
||
|
||
private static final long serialVersionUID = 1L;
|
||
|
||
private String commandId;
|
||
|
||
private Integer expectedDraftRevision;
|
||
|
||
private String sourceSnapshotId;
|
||
|
||
private String authorizationSnapshotId;
|
||
|
||
/**
|
||
* 确认模式
|
||
*/
|
||
public enum ConfirmModeEnum {
|
||
SINGLE("single"),
|
||
|
||
BATCH("batch");
|
||
|
||
private final String value;
|
||
|
||
ConfirmModeEnum(String value) {
|
||
this.value = value;
|
||
}
|
||
|
||
@JsonValue
|
||
public String getValue() {
|
||
return value;
|
||
}
|
||
|
||
@Override
|
||
public String toString() {
|
||
return String.valueOf(value);
|
||
}
|
||
|
||
@JsonCreator
|
||
public static ConfirmModeEnum fromValue(String value) {
|
||
for (ConfirmModeEnum b : ConfirmModeEnum.values()) {
|
||
if (b.value.equals(value)) {
|
||
return b;
|
||
}
|
||
}
|
||
throw new IllegalArgumentException("Unexpected value '" + value + "'");
|
||
}
|
||
}
|
||
|
||
private ConfirmModeEnum confirmMode;
|
||
|
||
/**
|
||
* 用户确认决策类型
|
||
*/
|
||
public enum DecisionTypeEnum {
|
||
ACCEPT("accept"),
|
||
|
||
ACCEPT_WITH_OVERRIDES("accept_with_overrides"),
|
||
|
||
RESOLVE_CONFLICT("resolve_conflict");
|
||
|
||
private final String value;
|
||
|
||
DecisionTypeEnum(String value) {
|
||
this.value = value;
|
||
}
|
||
|
||
@JsonValue
|
||
public String getValue() {
|
||
return value;
|
||
}
|
||
|
||
@Override
|
||
public String toString() {
|
||
return String.valueOf(value);
|
||
}
|
||
|
||
@JsonCreator
|
||
public static DecisionTypeEnum fromValue(String value) {
|
||
for (DecisionTypeEnum b : DecisionTypeEnum.values()) {
|
||
if (b.value.equals(value)) {
|
||
return b;
|
||
}
|
||
}
|
||
throw new IllegalArgumentException("Unexpected value '" + value + "'");
|
||
}
|
||
}
|
||
|
||
private DecisionTypeEnum decisionType;
|
||
|
||
private ConfirmKnowledgeDraftRequestRiskAcknowledgement riskAcknowledgement;
|
||
|
||
@Valid
|
||
private Map<String, Object> overrides = new HashMap<>();
|
||
|
||
public ConfirmKnowledgeDraftRequest() {
|
||
super();
|
||
}
|
||
|
||
/**
|
||
* Constructor with only required parameters
|
||
*/
|
||
public ConfirmKnowledgeDraftRequest(String commandId, Integer expectedDraftRevision, String sourceSnapshotId, String authorizationSnapshotId, ConfirmModeEnum confirmMode, DecisionTypeEnum decisionType, ConfirmKnowledgeDraftRequestRiskAcknowledgement riskAcknowledgement) {
|
||
this.commandId = commandId;
|
||
this.expectedDraftRevision = expectedDraftRevision;
|
||
this.sourceSnapshotId = sourceSnapshotId;
|
||
this.authorizationSnapshotId = authorizationSnapshotId;
|
||
this.confirmMode = confirmMode;
|
||
this.decisionType = decisionType;
|
||
this.riskAcknowledgement = riskAcknowledgement;
|
||
}
|
||
|
||
public ConfirmKnowledgeDraftRequest 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 ConfirmKnowledgeDraftRequest expectedDraftRevision(Integer expectedDraftRevision) {
|
||
this.expectedDraftRevision = expectedDraftRevision;
|
||
return this;
|
||
}
|
||
|
||
/**
|
||
* 草稿版本乐观锁,必须与服务端当前 draft revision 匹配
|
||
* @return expectedDraftRevision
|
||
*/
|
||
@NotNull
|
||
@Schema(name = "expectedDraftRevision", description = "草稿版本乐观锁,必须与服务端当前 draft revision 匹配", requiredMode = Schema.RequiredMode.REQUIRED)
|
||
@JsonProperty("expectedDraftRevision")
|
||
public Integer getExpectedDraftRevision() {
|
||
return expectedDraftRevision;
|
||
}
|
||
|
||
@JsonProperty("expectedDraftRevision")
|
||
public void setExpectedDraftRevision(Integer expectedDraftRevision) {
|
||
this.expectedDraftRevision = expectedDraftRevision;
|
||
}
|
||
|
||
public ConfirmKnowledgeDraftRequest sourceSnapshotId(String sourceSnapshotId) {
|
||
this.sourceSnapshotId = sourceSnapshotId;
|
||
return this;
|
||
}
|
||
|
||
/**
|
||
* 草稿生成时的来源快照 ID,用于防 stale 校验
|
||
* @return sourceSnapshotId
|
||
*/
|
||
@NotNull
|
||
@Schema(name = "sourceSnapshotId", description = "草稿生成时的来源快照 ID,用于防 stale 校验", requiredMode = Schema.RequiredMode.REQUIRED)
|
||
@JsonProperty("sourceSnapshotId")
|
||
public String getSourceSnapshotId() {
|
||
return sourceSnapshotId;
|
||
}
|
||
|
||
@JsonProperty("sourceSnapshotId")
|
||
public void setSourceSnapshotId(String sourceSnapshotId) {
|
||
this.sourceSnapshotId = sourceSnapshotId;
|
||
}
|
||
|
||
public ConfirmKnowledgeDraftRequest authorizationSnapshotId(String authorizationSnapshotId) {
|
||
this.authorizationSnapshotId = authorizationSnapshotId;
|
||
return this;
|
||
}
|
||
|
||
/**
|
||
* 草稿生成时的授权快照 ID,用于重新校验外发、生成和导出权限
|
||
* @return authorizationSnapshotId
|
||
*/
|
||
@NotNull
|
||
@Schema(name = "authorizationSnapshotId", description = "草稿生成时的授权快照 ID,用于重新校验外发、生成和导出权限", requiredMode = Schema.RequiredMode.REQUIRED)
|
||
@JsonProperty("authorizationSnapshotId")
|
||
public String getAuthorizationSnapshotId() {
|
||
return authorizationSnapshotId;
|
||
}
|
||
|
||
@JsonProperty("authorizationSnapshotId")
|
||
public void setAuthorizationSnapshotId(String authorizationSnapshotId) {
|
||
this.authorizationSnapshotId = authorizationSnapshotId;
|
||
}
|
||
|
||
public ConfirmKnowledgeDraftRequest confirmMode(ConfirmModeEnum confirmMode) {
|
||
this.confirmMode = confirmMode;
|
||
return this;
|
||
}
|
||
|
||
/**
|
||
* 确认模式
|
||
* @return confirmMode
|
||
*/
|
||
@NotNull
|
||
@Schema(name = "confirmMode", description = "确认模式", requiredMode = Schema.RequiredMode.REQUIRED)
|
||
@JsonProperty("confirmMode")
|
||
public ConfirmModeEnum getConfirmMode() {
|
||
return confirmMode;
|
||
}
|
||
|
||
@JsonProperty("confirmMode")
|
||
public void setConfirmMode(ConfirmModeEnum confirmMode) {
|
||
this.confirmMode = confirmMode;
|
||
}
|
||
|
||
public ConfirmKnowledgeDraftRequest decisionType(DecisionTypeEnum decisionType) {
|
||
this.decisionType = decisionType;
|
||
return this;
|
||
}
|
||
|
||
/**
|
||
* 用户确认决策类型
|
||
* @return decisionType
|
||
*/
|
||
@NotNull
|
||
@Schema(name = "decisionType", description = "用户确认决策类型", requiredMode = Schema.RequiredMode.REQUIRED)
|
||
@JsonProperty("decisionType")
|
||
public DecisionTypeEnum getDecisionType() {
|
||
return decisionType;
|
||
}
|
||
|
||
@JsonProperty("decisionType")
|
||
public void setDecisionType(DecisionTypeEnum decisionType) {
|
||
this.decisionType = decisionType;
|
||
}
|
||
|
||
public ConfirmKnowledgeDraftRequest riskAcknowledgement(ConfirmKnowledgeDraftRequestRiskAcknowledgement riskAcknowledgement) {
|
||
this.riskAcknowledgement = riskAcknowledgement;
|
||
return this;
|
||
}
|
||
|
||
/**
|
||
* Get riskAcknowledgement
|
||
* @return riskAcknowledgement
|
||
*/
|
||
@NotNull @Valid
|
||
@Schema(name = "riskAcknowledgement", requiredMode = Schema.RequiredMode.REQUIRED)
|
||
@JsonProperty("riskAcknowledgement")
|
||
public ConfirmKnowledgeDraftRequestRiskAcknowledgement getRiskAcknowledgement() {
|
||
return riskAcknowledgement;
|
||
}
|
||
|
||
@JsonProperty("riskAcknowledgement")
|
||
public void setRiskAcknowledgement(ConfirmKnowledgeDraftRequestRiskAcknowledgement riskAcknowledgement) {
|
||
this.riskAcknowledgement = riskAcknowledgement;
|
||
}
|
||
|
||
public ConfirmKnowledgeDraftRequest overrides(Map<String, Object> overrides) {
|
||
this.overrides = overrides;
|
||
return this;
|
||
}
|
||
|
||
public ConfirmKnowledgeDraftRequest putOverridesItem(String key, Object overridesItem) {
|
||
if (this.overrides == null) {
|
||
this.overrides = new HashMap<>();
|
||
}
|
||
this.overrides.put(key, overridesItem);
|
||
return this;
|
||
}
|
||
|
||
/**
|
||
* 手动修正的属性值
|
||
* @return overrides
|
||
*/
|
||
|
||
@Schema(name = "overrides", description = "手动修正的属性值", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||
@JsonProperty("overrides")
|
||
public Map<String, Object> getOverrides() {
|
||
return overrides;
|
||
}
|
||
|
||
@JsonProperty("overrides")
|
||
public void setOverrides(Map<String, Object> overrides) {
|
||
this.overrides = overrides;
|
||
}
|
||
|
||
@Override
|
||
public boolean equals(Object o) {
|
||
if (this == o) {
|
||
return true;
|
||
}
|
||
if (o == null || getClass() != o.getClass()) {
|
||
return false;
|
||
}
|
||
ConfirmKnowledgeDraftRequest confirmKnowledgeDraftRequest = (ConfirmKnowledgeDraftRequest) o;
|
||
return Objects.equals(this.commandId, confirmKnowledgeDraftRequest.commandId) &&
|
||
Objects.equals(this.expectedDraftRevision, confirmKnowledgeDraftRequest.expectedDraftRevision) &&
|
||
Objects.equals(this.sourceSnapshotId, confirmKnowledgeDraftRequest.sourceSnapshotId) &&
|
||
Objects.equals(this.authorizationSnapshotId, confirmKnowledgeDraftRequest.authorizationSnapshotId) &&
|
||
Objects.equals(this.confirmMode, confirmKnowledgeDraftRequest.confirmMode) &&
|
||
Objects.equals(this.decisionType, confirmKnowledgeDraftRequest.decisionType) &&
|
||
Objects.equals(this.riskAcknowledgement, confirmKnowledgeDraftRequest.riskAcknowledgement) &&
|
||
Objects.equals(this.overrides, confirmKnowledgeDraftRequest.overrides);
|
||
}
|
||
|
||
@Override
|
||
public int hashCode() {
|
||
return Objects.hash(commandId, expectedDraftRevision, sourceSnapshotId, authorizationSnapshotId, confirmMode, decisionType, riskAcknowledgement, overrides);
|
||
}
|
||
|
||
@Override
|
||
public String toString() {
|
||
StringBuilder sb = new StringBuilder();
|
||
sb.append("class ConfirmKnowledgeDraftRequest {\n");
|
||
sb.append(" commandId: ").append(toIndentedString(commandId)).append("\n");
|
||
sb.append(" expectedDraftRevision: ").append(toIndentedString(expectedDraftRevision)).append("\n");
|
||
sb.append(" sourceSnapshotId: ").append(toIndentedString(sourceSnapshotId)).append("\n");
|
||
sb.append(" authorizationSnapshotId: ").append(toIndentedString(authorizationSnapshotId)).append("\n");
|
||
sb.append(" confirmMode: ").append(toIndentedString(confirmMode)).append("\n");
|
||
sb.append(" decisionType: ").append(toIndentedString(decisionType)).append("\n");
|
||
sb.append(" riskAcknowledgement: ").append(toIndentedString(riskAcknowledgement)).append("\n");
|
||
sb.append(" overrides: ").append(toIndentedString(overrides)).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 ");
|
||
}
|
||
}
|
||
|