185 lines
4.8 KiB
Java
185 lines
4.8 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 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;
|
|
|
|
/**
|
|
* CancelHandoffRequest
|
|
*/
|
|
|
|
@JsonTypeName("cancelHandoff_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 CancelHandoffRequest implements Serializable {
|
|
|
|
private static final long serialVersionUID = 1L;
|
|
|
|
private UUID commandId;
|
|
|
|
/**
|
|
* 期望当前 handoff 状态,避免盲取消已处理 token
|
|
*/
|
|
public enum ExpectedStatusEnum {
|
|
PENDING("pending");
|
|
|
|
private final String value;
|
|
|
|
ExpectedStatusEnum(String value) {
|
|
this.value = value;
|
|
}
|
|
|
|
@JsonValue
|
|
public String getValue() {
|
|
return value;
|
|
}
|
|
|
|
@Override
|
|
public String toString() {
|
|
return String.valueOf(value);
|
|
}
|
|
|
|
@JsonCreator
|
|
public static ExpectedStatusEnum fromValue(String value) {
|
|
for (ExpectedStatusEnum b : ExpectedStatusEnum.values()) {
|
|
if (b.value.equals(value)) {
|
|
return b;
|
|
}
|
|
}
|
|
throw new IllegalArgumentException("Unexpected value '" + value + "'");
|
|
}
|
|
}
|
|
|
|
private ExpectedStatusEnum expectedStatus;
|
|
|
|
private String reason;
|
|
|
|
public CancelHandoffRequest() {
|
|
super();
|
|
}
|
|
|
|
/**
|
|
* Constructor with only required parameters
|
|
*/
|
|
public CancelHandoffRequest(UUID commandId, ExpectedStatusEnum expectedStatus, String reason) {
|
|
this.commandId = commandId;
|
|
this.expectedStatus = expectedStatus;
|
|
this.reason = reason;
|
|
}
|
|
|
|
public CancelHandoffRequest commandId(UUID commandId) {
|
|
this.commandId = commandId;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* 幂等键
|
|
* @return commandId
|
|
*/
|
|
@NotNull @Valid
|
|
@Schema(name = "commandId", description = "幂等键", requiredMode = Schema.RequiredMode.REQUIRED)
|
|
@JsonProperty("commandId")
|
|
public UUID getCommandId() {
|
|
return commandId;
|
|
}
|
|
|
|
@JsonProperty("commandId")
|
|
public void setCommandId(UUID commandId) {
|
|
this.commandId = commandId;
|
|
}
|
|
|
|
public CancelHandoffRequest expectedStatus(ExpectedStatusEnum expectedStatus) {
|
|
this.expectedStatus = expectedStatus;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* 期望当前 handoff 状态,避免盲取消已处理 token
|
|
* @return expectedStatus
|
|
*/
|
|
@NotNull
|
|
@Schema(name = "expectedStatus", description = "期望当前 handoff 状态,避免盲取消已处理 token", requiredMode = Schema.RequiredMode.REQUIRED)
|
|
@JsonProperty("expectedStatus")
|
|
public ExpectedStatusEnum getExpectedStatus() {
|
|
return expectedStatus;
|
|
}
|
|
|
|
@JsonProperty("expectedStatus")
|
|
public void setExpectedStatus(ExpectedStatusEnum expectedStatus) {
|
|
this.expectedStatus = expectedStatus;
|
|
}
|
|
|
|
public CancelHandoffRequest reason(String reason) {
|
|
this.reason = reason;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* 取消原因
|
|
* @return reason
|
|
*/
|
|
@NotNull
|
|
@Schema(name = "reason", description = "取消原因", requiredMode = Schema.RequiredMode.REQUIRED)
|
|
@JsonProperty("reason")
|
|
public String getReason() {
|
|
return reason;
|
|
}
|
|
|
|
@JsonProperty("reason")
|
|
public void setReason(String reason) {
|
|
this.reason = reason;
|
|
}
|
|
|
|
@Override
|
|
public boolean equals(Object o) {
|
|
if (this == o) {
|
|
return true;
|
|
}
|
|
if (o == null || getClass() != o.getClass()) {
|
|
return false;
|
|
}
|
|
CancelHandoffRequest cancelHandoffRequest = (CancelHandoffRequest) o;
|
|
return Objects.equals(this.commandId, cancelHandoffRequest.commandId) &&
|
|
Objects.equals(this.expectedStatus, cancelHandoffRequest.expectedStatus) &&
|
|
Objects.equals(this.reason, cancelHandoffRequest.reason);
|
|
}
|
|
|
|
@Override
|
|
public int hashCode() {
|
|
return Objects.hash(commandId, expectedStatus, reason);
|
|
}
|
|
|
|
@Override
|
|
public String toString() {
|
|
StringBuilder sb = new StringBuilder();
|
|
sb.append("class CancelHandoffRequest {\n");
|
|
sb.append(" commandId: ").append(toIndentedString(commandId)).append("\n");
|
|
sb.append(" expectedStatus: ").append(toIndentedString(expectedStatus)).append("\n");
|
|
sb.append(" reason: ").append(toIndentedString(reason)).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 ");
|
|
}
|
|
}
|
|
|