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.muse.dto.SourceAttributionLineage; import com.muse.dto.SourceAttributionSourcesInner; import java.util.ArrayList; import java.util.Arrays; import java.util.List; 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; /** * Block 当前 revision 的来源归因信息 */ @Schema(name = "SourceAttribution", description = "Block 当前 revision 的来源归因信息") @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 SourceAttribution implements Serializable { private static final long serialVersionUID = 1L; private UUID blockId; private Integer revision; @Valid private List<@Valid SourceAttributionSourcesInner> sources = new ArrayList<>(); private @Nullable SourceAttributionLineage lineage; public SourceAttribution() { super(); } /** * Constructor with only required parameters */ public SourceAttribution(UUID blockId, Integer revision) { this.blockId = blockId; this.revision = revision; } public SourceAttribution 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 SourceAttribution revision(Integer revision) { this.revision = revision; return this; } /** * Block 当前 revision 号 * @return revision */ @NotNull @Schema(name = "revision", description = "Block 当前 revision 号", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("revision") public Integer getRevision() { return revision; } @JsonProperty("revision") public void setRevision(Integer revision) { this.revision = revision; } public SourceAttribution sources(List<@Valid SourceAttributionSourcesInner> sources) { this.sources = sources; return this; } public SourceAttribution addSourcesItem(SourceAttributionSourcesInner sourcesItem) { if (this.sources == null) { this.sources = new ArrayList<>(); } this.sources.add(sourcesItem); return this; } /** * 来源归因列表 * @return sources */ @Valid @Schema(name = "sources", description = "来源归因列表", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("sources") public List<@Valid SourceAttributionSourcesInner> getSources() { return sources; } @JsonProperty("sources") public void setSources(List<@Valid SourceAttributionSourcesInner> sources) { this.sources = sources; } public SourceAttribution lineage(@Nullable SourceAttributionLineage lineage) { this.lineage = lineage; return this; } /** * Get lineage * @return lineage */ @Valid @Schema(name = "lineage", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("lineage") public @Nullable SourceAttributionLineage getLineage() { return lineage; } @JsonProperty("lineage") public void setLineage(@Nullable SourceAttributionLineage lineage) { this.lineage = lineage; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } SourceAttribution sourceAttribution = (SourceAttribution) o; return Objects.equals(this.blockId, sourceAttribution.blockId) && Objects.equals(this.revision, sourceAttribution.revision) && Objects.equals(this.sources, sourceAttribution.sources) && Objects.equals(this.lineage, sourceAttribution.lineage); } @Override public int hashCode() { return Objects.hash(blockId, revision, sources, lineage); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class SourceAttribution {\n"); sb.append(" blockId: ").append(toIndentedString(blockId)).append("\n"); sb.append(" revision: ").append(toIndentedString(revision)).append("\n"); sb.append(" sources: ").append(toIndentedString(sources)).append("\n"); sb.append(" lineage: ").append(toIndentedString(lineage)).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 "); } }