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.SourceEventDetailReasonAttributionsInner; import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.Arrays; import java.util.List; 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; /** * SourceEventDetail */ @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 SourceEventDetail implements Serializable { private static final long serialVersionUID = 1L; private UUID eventId; private String sourceType; private UUID sourceId; /** * Gets or Sets sourceStatus */ public enum SourceStatusEnum { ACTIVE("active"), STALE("stale"), REVOKED("revoked"), RECALLED("recalled"), DELISTED("delisted"), BLOCKED("blocked"), OWNER_MISSING("owner_missing"), UNAUTHORIZED("unauthorized"); private final String value; SourceStatusEnum(String value) { this.value = value; } @JsonValue public String getValue() { return value; } @Override public String toString() { return String.valueOf(value); } @JsonCreator public static SourceStatusEnum fromValue(String value) { for (SourceStatusEnum b : SourceStatusEnum.values()) { if (b.value.equals(value)) { return b; } } throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } private SourceStatusEnum sourceStatus; /** * Gets or Sets actionPolicy */ public enum ActionPolicyEnum { ALLOWED("allowed"), READ_ONLY("read_only"), BLOCKED("blocked"), NEEDS_RECHECK("needs_recheck"); private final String value; ActionPolicyEnum(String value) { this.value = value; } @JsonValue public String getValue() { return value; } @Override public String toString() { return String.valueOf(value); } @JsonCreator public static ActionPolicyEnum fromValue(String value) { for (ActionPolicyEnum b : ActionPolicyEnum.values()) { if (b.value.equals(value)) { return b; } } throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } private ActionPolicyEnum actionPolicy; @Valid private List<@Valid SourceEventDetailReasonAttributionsInner> reasonAttributions = new ArrayList<>(); private @Nullable Integer affectedBindings; private @Nullable Integer affectedTasks; private @Nullable String propagationStatus; private @Nullable UUID jobId; @Valid private List nextActions = new ArrayList<>(); @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime createdAt; public SourceEventDetail() { super(); } /** * Constructor with only required parameters */ public SourceEventDetail(UUID eventId, String sourceType, UUID sourceId, SourceStatusEnum sourceStatus, ActionPolicyEnum actionPolicy, List<@Valid SourceEventDetailReasonAttributionsInner> reasonAttributions, OffsetDateTime createdAt) { this.eventId = eventId; this.sourceType = sourceType; this.sourceId = sourceId; this.sourceStatus = sourceStatus; this.actionPolicy = actionPolicy; this.reasonAttributions = reasonAttributions; this.createdAt = createdAt; } public SourceEventDetail eventId(UUID eventId) { this.eventId = eventId; return this; } /** * Get eventId * @return eventId */ @NotNull @Valid @Schema(name = "eventId", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("eventId") public UUID getEventId() { return eventId; } @JsonProperty("eventId") public void setEventId(UUID eventId) { this.eventId = eventId; } public SourceEventDetail sourceType(String sourceType) { this.sourceType = sourceType; return this; } /** * Get sourceType * @return sourceType */ @NotNull @Schema(name = "sourceType", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("sourceType") public String getSourceType() { return sourceType; } @JsonProperty("sourceType") public void setSourceType(String sourceType) { this.sourceType = sourceType; } public SourceEventDetail sourceId(UUID sourceId) { this.sourceId = sourceId; return this; } /** * Get sourceId * @return sourceId */ @NotNull @Valid @Schema(name = "sourceId", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("sourceId") public UUID getSourceId() { return sourceId; } @JsonProperty("sourceId") public void setSourceId(UUID sourceId) { this.sourceId = sourceId; } public SourceEventDetail sourceStatus(SourceStatusEnum sourceStatus) { this.sourceStatus = sourceStatus; return this; } /** * Get sourceStatus * @return sourceStatus */ @NotNull @Schema(name = "sourceStatus", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("sourceStatus") public SourceStatusEnum getSourceStatus() { return sourceStatus; } @JsonProperty("sourceStatus") public void setSourceStatus(SourceStatusEnum sourceStatus) { this.sourceStatus = sourceStatus; } public SourceEventDetail actionPolicy(ActionPolicyEnum actionPolicy) { this.actionPolicy = actionPolicy; return this; } /** * Get actionPolicy * @return actionPolicy */ @NotNull @Schema(name = "actionPolicy", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("actionPolicy") public ActionPolicyEnum getActionPolicy() { return actionPolicy; } @JsonProperty("actionPolicy") public void setActionPolicy(ActionPolicyEnum actionPolicy) { this.actionPolicy = actionPolicy; } public SourceEventDetail reasonAttributions(List<@Valid SourceEventDetailReasonAttributionsInner> reasonAttributions) { this.reasonAttributions = reasonAttributions; return this; } public SourceEventDetail addReasonAttributionsItem(SourceEventDetailReasonAttributionsInner reasonAttributionsItem) { if (this.reasonAttributions == null) { this.reasonAttributions = new ArrayList<>(); } this.reasonAttributions.add(reasonAttributionsItem); return this; } /** * 原因归因列表 * @return reasonAttributions */ @NotNull @Valid @Schema(name = "reasonAttributions", description = "原因归因列表", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("reasonAttributions") public List<@Valid SourceEventDetailReasonAttributionsInner> getReasonAttributions() { return reasonAttributions; } @JsonProperty("reasonAttributions") public void setReasonAttributions(List<@Valid SourceEventDetailReasonAttributionsInner> reasonAttributions) { this.reasonAttributions = reasonAttributions; } public SourceEventDetail affectedBindings(@Nullable Integer affectedBindings) { this.affectedBindings = affectedBindings; return this; } /** * 受影响的绑定数 * @return affectedBindings */ @Schema(name = "affectedBindings", description = "受影响的绑定数", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("affectedBindings") public @Nullable Integer getAffectedBindings() { return affectedBindings; } @JsonProperty("affectedBindings") public void setAffectedBindings(@Nullable Integer affectedBindings) { this.affectedBindings = affectedBindings; } public SourceEventDetail affectedTasks(@Nullable Integer affectedTasks) { this.affectedTasks = affectedTasks; return this; } /** * 受影响的任务数 * @return affectedTasks */ @Schema(name = "affectedTasks", description = "受影响的任务数", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("affectedTasks") public @Nullable Integer getAffectedTasks() { return affectedTasks; } @JsonProperty("affectedTasks") public void setAffectedTasks(@Nullable Integer affectedTasks) { this.affectedTasks = affectedTasks; } public SourceEventDetail propagationStatus(@Nullable String propagationStatus) { this.propagationStatus = propagationStatus; return this; } /** * 传播状态 * @return propagationStatus */ @Schema(name = "propagationStatus", description = "传播状态", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("propagationStatus") public @Nullable String getPropagationStatus() { return propagationStatus; } @JsonProperty("propagationStatus") public void setPropagationStatus(@Nullable String propagationStatus) { this.propagationStatus = propagationStatus; } public SourceEventDetail jobId(@Nullable UUID jobId) { this.jobId = jobId; return this; } /** * 关联的传播任务 ID * @return jobId */ @Valid @Schema(name = "jobId", description = "关联的传播任务 ID", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("jobId") public @Nullable UUID getJobId() { return jobId; } @JsonProperty("jobId") public void setJobId(@Nullable UUID jobId) { this.jobId = jobId; } public SourceEventDetail nextActions(List nextActions) { this.nextActions = nextActions; return this; } public SourceEventDetail addNextActionsItem(String nextActionsItem) { if (this.nextActions == null) { this.nextActions = new ArrayList<>(); } this.nextActions.add(nextActionsItem); return this; } /** * Get nextActions * @return nextActions */ @Schema(name = "nextActions", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("nextActions") public List getNextActions() { return nextActions; } @JsonProperty("nextActions") public void setNextActions(List nextActions) { this.nextActions = nextActions; } public SourceEventDetail createdAt(OffsetDateTime createdAt) { this.createdAt = createdAt; return this; } /** * Get createdAt * @return createdAt */ @NotNull @Valid @Schema(name = "createdAt", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("createdAt") public OffsetDateTime getCreatedAt() { return createdAt; } @JsonProperty("createdAt") public void setCreatedAt(OffsetDateTime createdAt) { this.createdAt = createdAt; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } SourceEventDetail sourceEventDetail = (SourceEventDetail) o; return Objects.equals(this.eventId, sourceEventDetail.eventId) && Objects.equals(this.sourceType, sourceEventDetail.sourceType) && Objects.equals(this.sourceId, sourceEventDetail.sourceId) && Objects.equals(this.sourceStatus, sourceEventDetail.sourceStatus) && Objects.equals(this.actionPolicy, sourceEventDetail.actionPolicy) && Objects.equals(this.reasonAttributions, sourceEventDetail.reasonAttributions) && Objects.equals(this.affectedBindings, sourceEventDetail.affectedBindings) && Objects.equals(this.affectedTasks, sourceEventDetail.affectedTasks) && Objects.equals(this.propagationStatus, sourceEventDetail.propagationStatus) && Objects.equals(this.jobId, sourceEventDetail.jobId) && Objects.equals(this.nextActions, sourceEventDetail.nextActions) && Objects.equals(this.createdAt, sourceEventDetail.createdAt); } @Override public int hashCode() { return Objects.hash(eventId, sourceType, sourceId, sourceStatus, actionPolicy, reasonAttributions, affectedBindings, affectedTasks, propagationStatus, jobId, nextActions, createdAt); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class SourceEventDetail {\n"); sb.append(" eventId: ").append(toIndentedString(eventId)).append("\n"); sb.append(" sourceType: ").append(toIndentedString(sourceType)).append("\n"); sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); sb.append(" sourceStatus: ").append(toIndentedString(sourceStatus)).append("\n"); sb.append(" actionPolicy: ").append(toIndentedString(actionPolicy)).append("\n"); sb.append(" reasonAttributions: ").append(toIndentedString(reasonAttributions)).append("\n"); sb.append(" affectedBindings: ").append(toIndentedString(affectedBindings)).append("\n"); sb.append(" affectedTasks: ").append(toIndentedString(affectedTasks)).append("\n"); sb.append(" propagationStatus: ").append(toIndentedString(propagationStatus)).append("\n"); sb.append(" jobId: ").append(toIndentedString(jobId)).append("\n"); sb.append(" nextActions: ").append(toIndentedString(nextActions)).append("\n"); sb.append(" createdAt: ").append(toIndentedString(createdAt)).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 "); } }