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

238 lines
6.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.fasterxml.jackson.annotation.JsonValue;
import com.muse.dto.SourceAttribution;
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;
/**
* AI suggestion 写入 Canonical Block 的结果
*/
@Schema(name = "MergeBlockSuggestionResult", description = "AI suggestion 写入 Canonical Block 的结果")
@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 MergeBlockSuggestionResult implements Serializable {
private static final long serialVersionUID = 1L;
private UUID blockId;
private UUID suggestionId;
private Integer newRevision;
/**
* Gets or Sets decisionType
*/
public enum DecisionTypeEnum {
ACCEPT("accept"),
MODIFY_THEN_MERGE("modify_then_merge");
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 @Nullable SourceAttribution sourceAttribution;
public MergeBlockSuggestionResult() {
super();
}
/**
* Constructor with only required parameters
*/
public MergeBlockSuggestionResult(UUID blockId, UUID suggestionId, Integer newRevision, DecisionTypeEnum decisionType) {
this.blockId = blockId;
this.suggestionId = suggestionId;
this.newRevision = newRevision;
this.decisionType = decisionType;
}
public MergeBlockSuggestionResult blockId(UUID blockId) {
this.blockId = blockId;
return this;
}
/**
* Get blockId
* @return blockId
*/
@NotNull @Valid
@Schema(name = "blockId", requiredMode = Schema.RequiredMode.REQUIRED)
@JsonProperty("blockId")
public UUID getBlockId() {
return blockId;
}
@JsonProperty("blockId")
public void setBlockId(UUID blockId) {
this.blockId = blockId;
}
public MergeBlockSuggestionResult suggestionId(UUID suggestionId) {
this.suggestionId = suggestionId;
return this;
}
/**
* Get suggestionId
* @return suggestionId
*/
@NotNull @Valid
@Schema(name = "suggestionId", requiredMode = Schema.RequiredMode.REQUIRED)
@JsonProperty("suggestionId")
public UUID getSuggestionId() {
return suggestionId;
}
@JsonProperty("suggestionId")
public void setSuggestionId(UUID suggestionId) {
this.suggestionId = suggestionId;
}
public MergeBlockSuggestionResult newRevision(Integer newRevision) {
this.newRevision = newRevision;
return this;
}
/**
* Block 保存成功后的新 revision
* @return newRevision
*/
@NotNull
@Schema(name = "newRevision", description = "Block 保存成功后的新 revision", requiredMode = Schema.RequiredMode.REQUIRED)
@JsonProperty("newRevision")
public Integer getNewRevision() {
return newRevision;
}
@JsonProperty("newRevision")
public void setNewRevision(Integer newRevision) {
this.newRevision = newRevision;
}
public MergeBlockSuggestionResult decisionType(DecisionTypeEnum decisionType) {
this.decisionType = decisionType;
return this;
}
/**
* Get decisionType
* @return decisionType
*/
@NotNull
@Schema(name = "decisionType", requiredMode = Schema.RequiredMode.REQUIRED)
@JsonProperty("decisionType")
public DecisionTypeEnum getDecisionType() {
return decisionType;
}
@JsonProperty("decisionType")
public void setDecisionType(DecisionTypeEnum decisionType) {
this.decisionType = decisionType;
}
public MergeBlockSuggestionResult sourceAttribution(@Nullable SourceAttribution sourceAttribution) {
this.sourceAttribution = sourceAttribution;
return this;
}
/**
* Get sourceAttribution
* @return sourceAttribution
*/
@Valid
@Schema(name = "sourceAttribution", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("sourceAttribution")
public @Nullable SourceAttribution getSourceAttribution() {
return sourceAttribution;
}
@JsonProperty("sourceAttribution")
public void setSourceAttribution(@Nullable SourceAttribution sourceAttribution) {
this.sourceAttribution = sourceAttribution;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
MergeBlockSuggestionResult mergeBlockSuggestionResult = (MergeBlockSuggestionResult) o;
return Objects.equals(this.blockId, mergeBlockSuggestionResult.blockId) &&
Objects.equals(this.suggestionId, mergeBlockSuggestionResult.suggestionId) &&
Objects.equals(this.newRevision, mergeBlockSuggestionResult.newRevision) &&
Objects.equals(this.decisionType, mergeBlockSuggestionResult.decisionType) &&
Objects.equals(this.sourceAttribution, mergeBlockSuggestionResult.sourceAttribution);
}
@Override
public int hashCode() {
return Objects.hash(blockId, suggestionId, newRevision, decisionType, sourceAttribution);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class MergeBlockSuggestionResult {\n");
sb.append(" blockId: ").append(toIndentedString(blockId)).append("\n");
sb.append(" suggestionId: ").append(toIndentedString(suggestionId)).append("\n");
sb.append(" newRevision: ").append(toIndentedString(newRevision)).append("\n");
sb.append(" decisionType: ").append(toIndentedString(decisionType)).append("\n");
sb.append(" sourceAttribution: ").append(toIndentedString(sourceAttribution)).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 ");
}
}