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.AssetActionPolicy; import com.muse.dto.SourceStatus; import java.time.OffsetDateTime; import java.util.UUID; import org.springframework.format.annotation.DateTimeFormat; 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; /** * 来源侧授权摘要和 handoff 准备结果,不包含目标 owner 预检 ID。 */ @Schema(name = "BindPrecheckResult", description = "来源侧授权摘要和 handoff 准备结果,不包含目标 owner 预检 ID。") @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 BindPrecheckResult implements Serializable { private static final long serialVersionUID = 1L; private UUID authorizationSummaryId; private UUID authorizationSnapshotId; private UUID assetId; private Integer sourceVersion; private SourceStatus sourceStatus; /** * Gets or Sets targetOwner */ public enum TargetOwnerEnum { AGENT("agent"), KNOWLEDGE("knowledge"), CONTENT("content"); private final String value; TargetOwnerEnum(String value) { this.value = value; } @JsonValue public String getValue() { return value; } @Override public String toString() { return String.valueOf(value); } @JsonCreator public static TargetOwnerEnum fromValue(String value) { for (TargetOwnerEnum b : TargetOwnerEnum.values()) { if (b.value.equals(value)) { return b; } } throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } private TargetOwnerEnum targetOwner; /** * Gets or Sets targetAction */ public enum TargetActionEnum { SLOT_BIND("slot_bind"), BIND("bind"), ASSET_USE("asset_use"); private final String value; TargetActionEnum(String value) { this.value = value; } @JsonValue public String getValue() { return value; } @Override public String toString() { return String.valueOf(value); } @JsonCreator public static TargetActionEnum fromValue(String value) { for (TargetActionEnum b : TargetActionEnum.values()) { if (b.value.equals(value)) { return b; } } throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } private TargetActionEnum targetAction; private @Nullable UUID targetWorkId; private @Nullable String authorizationSnapshot; private @Nullable AssetActionPolicy actionPolicy; private Boolean handoffReady; private @Nullable String compatibilityResult; @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime expiresAt; public BindPrecheckResult() { super(); } /** * Constructor with only required parameters */ public BindPrecheckResult(UUID authorizationSummaryId, UUID authorizationSnapshotId, UUID assetId, Integer sourceVersion, SourceStatus sourceStatus, TargetOwnerEnum targetOwner, TargetActionEnum targetAction, Boolean handoffReady, OffsetDateTime expiresAt) { this.authorizationSummaryId = authorizationSummaryId; this.authorizationSnapshotId = authorizationSnapshotId; this.assetId = assetId; this.sourceVersion = sourceVersion; this.sourceStatus = sourceStatus; this.targetOwner = targetOwner; this.targetAction = targetAction; this.handoffReady = handoffReady; this.expiresAt = expiresAt; } public BindPrecheckResult authorizationSummaryId(UUID authorizationSummaryId) { this.authorizationSummaryId = authorizationSummaryId; return this; } /** * 来源侧授权摘要 ID,供目标 owner 预检消费 * @return authorizationSummaryId */ @NotNull @Valid @Schema(name = "authorizationSummaryId", description = "来源侧授权摘要 ID,供目标 owner 预检消费", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("authorizationSummaryId") public UUID getAuthorizationSummaryId() { return authorizationSummaryId; } @JsonProperty("authorizationSummaryId") public void setAuthorizationSummaryId(UUID authorizationSummaryId) { this.authorizationSummaryId = authorizationSummaryId; } public BindPrecheckResult authorizationSnapshotId(UUID authorizationSnapshotId) { this.authorizationSnapshotId = authorizationSnapshotId; return this; } /** * 来源授权快照 ID * @return authorizationSnapshotId */ @NotNull @Valid @Schema(name = "authorizationSnapshotId", description = "来源授权快照 ID", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("authorizationSnapshotId") public UUID getAuthorizationSnapshotId() { return authorizationSnapshotId; } @JsonProperty("authorizationSnapshotId") public void setAuthorizationSnapshotId(UUID authorizationSnapshotId) { this.authorizationSnapshotId = authorizationSnapshotId; } public BindPrecheckResult assetId(UUID assetId) { this.assetId = assetId; return this; } /** * Get assetId * @return assetId */ @NotNull @Valid @Schema(name = "assetId", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("assetId") public UUID getAssetId() { return assetId; } @JsonProperty("assetId") public void setAssetId(UUID assetId) { this.assetId = assetId; } public BindPrecheckResult sourceVersion(Integer sourceVersion) { this.sourceVersion = sourceVersion; return this; } /** * 来源资产版本 * @return sourceVersion */ @NotNull @Schema(name = "sourceVersion", description = "来源资产版本", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("sourceVersion") public Integer getSourceVersion() { return sourceVersion; } @JsonProperty("sourceVersion") public void setSourceVersion(Integer sourceVersion) { this.sourceVersion = sourceVersion; } public BindPrecheckResult sourceStatus(SourceStatus sourceStatus) { this.sourceStatus = sourceStatus; return this; } /** * Get sourceStatus * @return sourceStatus */ @NotNull @Valid @Schema(name = "sourceStatus", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("sourceStatus") public SourceStatus getSourceStatus() { return sourceStatus; } @JsonProperty("sourceStatus") public void setSourceStatus(SourceStatus sourceStatus) { this.sourceStatus = sourceStatus; } public BindPrecheckResult targetOwner(TargetOwnerEnum targetOwner) { this.targetOwner = targetOwner; return this; } /** * Get targetOwner * @return targetOwner */ @NotNull @Schema(name = "targetOwner", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("targetOwner") public TargetOwnerEnum getTargetOwner() { return targetOwner; } @JsonProperty("targetOwner") public void setTargetOwner(TargetOwnerEnum targetOwner) { this.targetOwner = targetOwner; } public BindPrecheckResult targetAction(TargetActionEnum targetAction) { this.targetAction = targetAction; return this; } /** * Get targetAction * @return targetAction */ @NotNull @Schema(name = "targetAction", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("targetAction") public TargetActionEnum getTargetAction() { return targetAction; } @JsonProperty("targetAction") public void setTargetAction(TargetActionEnum targetAction) { this.targetAction = targetAction; } public BindPrecheckResult targetWorkId(@Nullable UUID targetWorkId) { this.targetWorkId = targetWorkId; return this; } /** * Get targetWorkId * @return targetWorkId */ @Valid @Schema(name = "targetWorkId", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("targetWorkId") public @Nullable UUID getTargetWorkId() { return targetWorkId; } @JsonProperty("targetWorkId") public void setTargetWorkId(@Nullable UUID targetWorkId) { this.targetWorkId = targetWorkId; } public BindPrecheckResult authorizationSnapshot(@Nullable String authorizationSnapshot) { this.authorizationSnapshot = authorizationSnapshot; return this; } /** * 授权快照摘要 * @return authorizationSnapshot */ @Schema(name = "authorizationSnapshot", description = "授权快照摘要", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("authorizationSnapshot") public @Nullable String getAuthorizationSnapshot() { return authorizationSnapshot; } @JsonProperty("authorizationSnapshot") public void setAuthorizationSnapshot(@Nullable String authorizationSnapshot) { this.authorizationSnapshot = authorizationSnapshot; } public BindPrecheckResult actionPolicy(@Nullable AssetActionPolicy actionPolicy) { this.actionPolicy = actionPolicy; return this; } /** * Get actionPolicy * @return actionPolicy */ @Valid @Schema(name = "actionPolicy", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("actionPolicy") public @Nullable AssetActionPolicy getActionPolicy() { return actionPolicy; } @JsonProperty("actionPolicy") public void setActionPolicy(@Nullable AssetActionPolicy actionPolicy) { this.actionPolicy = actionPolicy; } public BindPrecheckResult handoffReady(Boolean handoffReady) { this.handoffReady = handoffReady; return this; } /** * 是否具备创建 handoff 的来源侧条件 * @return handoffReady */ @NotNull @Schema(name = "handoffReady", description = "是否具备创建 handoff 的来源侧条件", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("handoffReady") public Boolean getHandoffReady() { return handoffReady; } @JsonProperty("handoffReady") public void setHandoffReady(Boolean handoffReady) { this.handoffReady = handoffReady; } public BindPrecheckResult compatibilityResult(@Nullable String compatibilityResult) { this.compatibilityResult = compatibilityResult; return this; } /** * 来源侧兼容性摘要;目标 owner 仍必须自行执行目标预检 * @return compatibilityResult */ @Schema(name = "compatibilityResult", description = "来源侧兼容性摘要;目标 owner 仍必须自行执行目标预检", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("compatibilityResult") public @Nullable String getCompatibilityResult() { return compatibilityResult; } @JsonProperty("compatibilityResult") public void setCompatibilityResult(@Nullable String compatibilityResult) { this.compatibilityResult = compatibilityResult; } public BindPrecheckResult expiresAt(OffsetDateTime expiresAt) { this.expiresAt = expiresAt; return this; } /** * 预检过期时间 * @return expiresAt */ @NotNull @Valid @Schema(name = "expiresAt", description = "预检过期时间", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("expiresAt") public OffsetDateTime getExpiresAt() { return expiresAt; } @JsonProperty("expiresAt") public void setExpiresAt(OffsetDateTime expiresAt) { this.expiresAt = expiresAt; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } BindPrecheckResult bindPrecheckResult = (BindPrecheckResult) o; return Objects.equals(this.authorizationSummaryId, bindPrecheckResult.authorizationSummaryId) && Objects.equals(this.authorizationSnapshotId, bindPrecheckResult.authorizationSnapshotId) && Objects.equals(this.assetId, bindPrecheckResult.assetId) && Objects.equals(this.sourceVersion, bindPrecheckResult.sourceVersion) && Objects.equals(this.sourceStatus, bindPrecheckResult.sourceStatus) && Objects.equals(this.targetOwner, bindPrecheckResult.targetOwner) && Objects.equals(this.targetAction, bindPrecheckResult.targetAction) && Objects.equals(this.targetWorkId, bindPrecheckResult.targetWorkId) && Objects.equals(this.authorizationSnapshot, bindPrecheckResult.authorizationSnapshot) && Objects.equals(this.actionPolicy, bindPrecheckResult.actionPolicy) && Objects.equals(this.handoffReady, bindPrecheckResult.handoffReady) && Objects.equals(this.compatibilityResult, bindPrecheckResult.compatibilityResult) && Objects.equals(this.expiresAt, bindPrecheckResult.expiresAt); } @Override public int hashCode() { return Objects.hash(authorizationSummaryId, authorizationSnapshotId, assetId, sourceVersion, sourceStatus, targetOwner, targetAction, targetWorkId, authorizationSnapshot, actionPolicy, handoffReady, compatibilityResult, expiresAt); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class BindPrecheckResult {\n"); sb.append(" authorizationSummaryId: ").append(toIndentedString(authorizationSummaryId)).append("\n"); sb.append(" authorizationSnapshotId: ").append(toIndentedString(authorizationSnapshotId)).append("\n"); sb.append(" assetId: ").append(toIndentedString(assetId)).append("\n"); sb.append(" sourceVersion: ").append(toIndentedString(sourceVersion)).append("\n"); sb.append(" sourceStatus: ").append(toIndentedString(sourceStatus)).append("\n"); sb.append(" targetOwner: ").append(toIndentedString(targetOwner)).append("\n"); sb.append(" targetAction: ").append(toIndentedString(targetAction)).append("\n"); sb.append(" targetWorkId: ").append(toIndentedString(targetWorkId)).append("\n"); sb.append(" authorizationSnapshot: ").append(toIndentedString(authorizationSnapshot)).append("\n"); sb.append(" actionPolicy: ").append(toIndentedString(actionPolicy)).append("\n"); sb.append(" handoffReady: ").append(toIndentedString(handoffReady)).append("\n"); sb.append(" compatibilityResult: ").append(toIndentedString(compatibilityResult)).append("\n"); sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).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 "); } }