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 java.time.OffsetDateTime; 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; /** * 安全事件摘要 */ @Schema(name = "SecurityEventSummary", description = "安全事件摘要") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2026-05-24T15:05:54.603829+08:00[Asia/Shanghai]", comments = "Generator version: 7.22.0") public class SecurityEventSummary implements Serializable { private static final long serialVersionUID = 1L; private String eventId; /** * 事件类型 */ public enum EventTypeEnum { LOGIN_ANOMALY("login_anomaly"), CREDENTIAL_EXPIRED("credential_expired"), SENSITIVE_EXPORT("sensitive_export"), ACCESS_DENIED_BURST("access_denied_burst"), DEVICE_CHANGE("device_change"), PERMISSION_ESCALATION("permission_escalation"); private final String value; EventTypeEnum(String value) { this.value = value; } @JsonValue public String getValue() { return value; } @Override public String toString() { return String.valueOf(value); } @JsonCreator public static EventTypeEnum fromValue(String value) { for (EventTypeEnum b : EventTypeEnum.values()) { if (b.value.equals(value)) { return b; } } throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } private EventTypeEnum eventType; /** * 严重程度 */ public enum SeverityEnum { INFO("info"), WARNING("warning"), CRITICAL("critical"); private final String value; SeverityEnum(String value) { this.value = value; } @JsonValue public String getValue() { return value; } @Override public String toString() { return String.valueOf(value); } @JsonCreator public static SeverityEnum fromValue(String value) { for (SeverityEnum b : SeverityEnum.values()) { if (b.value.equals(value)) { return b; } } throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } private SeverityEnum severity; @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime occurredAt; private @Nullable String description; private @Nullable Boolean acknowledged; public SecurityEventSummary() { super(); } /** * Constructor with only required parameters */ public SecurityEventSummary(String eventId, EventTypeEnum eventType, SeverityEnum severity, OffsetDateTime occurredAt) { this.eventId = eventId; this.eventType = eventType; this.severity = severity; this.occurredAt = occurredAt; } public SecurityEventSummary eventId(String eventId) { this.eventId = eventId; return this; } /** * 安全事件 ID * @return eventId */ @NotNull @Schema(name = "eventId", description = "安全事件 ID", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("eventId") public String getEventId() { return eventId; } @JsonProperty("eventId") public void setEventId(String eventId) { this.eventId = eventId; } public SecurityEventSummary eventType(EventTypeEnum eventType) { this.eventType = eventType; return this; } /** * 事件类型 * @return eventType */ @NotNull @Schema(name = "eventType", description = "事件类型", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("eventType") public EventTypeEnum getEventType() { return eventType; } @JsonProperty("eventType") public void setEventType(EventTypeEnum eventType) { this.eventType = eventType; } public SecurityEventSummary severity(SeverityEnum severity) { this.severity = severity; return this; } /** * 严重程度 * @return severity */ @NotNull @Schema(name = "severity", description = "严重程度", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("severity") public SeverityEnum getSeverity() { return severity; } @JsonProperty("severity") public void setSeverity(SeverityEnum severity) { this.severity = severity; } public SecurityEventSummary occurredAt(OffsetDateTime occurredAt) { this.occurredAt = occurredAt; return this; } /** * 事件发生时间 * @return occurredAt */ @NotNull @Valid @Schema(name = "occurredAt", description = "事件发生时间", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("occurredAt") public OffsetDateTime getOccurredAt() { return occurredAt; } @JsonProperty("occurredAt") public void setOccurredAt(OffsetDateTime occurredAt) { this.occurredAt = occurredAt; } public SecurityEventSummary description(@Nullable String description) { this.description = description; return this; } /** * 事件简短描述 * @return description */ @Schema(name = "description", description = "事件简短描述", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("description") public @Nullable String getDescription() { return description; } @JsonProperty("description") public void setDescription(@Nullable String description) { this.description = description; } public SecurityEventSummary acknowledged(@Nullable Boolean acknowledged) { this.acknowledged = acknowledged; return this; } /** * 是否已确认 * @return acknowledged */ @Schema(name = "acknowledged", description = "是否已确认", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("acknowledged") public @Nullable Boolean getAcknowledged() { return acknowledged; } @JsonProperty("acknowledged") public void setAcknowledged(@Nullable Boolean acknowledged) { this.acknowledged = acknowledged; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } SecurityEventSummary securityEventSummary = (SecurityEventSummary) o; return Objects.equals(this.eventId, securityEventSummary.eventId) && Objects.equals(this.eventType, securityEventSummary.eventType) && Objects.equals(this.severity, securityEventSummary.severity) && Objects.equals(this.occurredAt, securityEventSummary.occurredAt) && Objects.equals(this.description, securityEventSummary.description) && Objects.equals(this.acknowledged, securityEventSummary.acknowledged); } @Override public int hashCode() { return Objects.hash(eventId, eventType, severity, occurredAt, description, acknowledged); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class SecurityEventSummary {\n"); sb.append(" eventId: ").append(toIndentedString(eventId)).append("\n"); sb.append(" eventType: ").append(toIndentedString(eventType)).append("\n"); sb.append(" severity: ").append(toIndentedString(severity)).append("\n"); sb.append(" occurredAt: ").append(toIndentedString(occurredAt)).append("\n"); sb.append(" description: ").append(toIndentedString(description)).append("\n"); sb.append(" acknowledged: ").append(toIndentedString(acknowledged)).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 "); } }