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.MetaField; import java.util.ArrayList; import java.util.Arrays; import java.util.List; 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; /** * MetaSchemaDraftRequest */ @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 MetaSchemaDraftRequest implements Serializable { private static final long serialVersionUID = 1L; private String commandId; private @Nullable Integer expectedVersion; private @Nullable String displayName; private @Nullable String description; @Valid private List<@Valid MetaField> fields = new ArrayList<>(); public MetaSchemaDraftRequest() { super(); } /** * Constructor with only required parameters */ public MetaSchemaDraftRequest(String commandId) { this.commandId = commandId; } public MetaSchemaDraftRequest commandId(String commandId) { this.commandId = commandId; return this; } /** * 幂等键 * @return commandId */ @NotNull @Schema(name = "commandId", description = "幂等键", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("commandId") public String getCommandId() { return commandId; } @JsonProperty("commandId") public void setCommandId(String commandId) { this.commandId = commandId; } public MetaSchemaDraftRequest expectedVersion(@Nullable Integer expectedVersion) { this.expectedVersion = expectedVersion; return this; } /** * 期望当前 active 版本,用于乐观锁 * @return expectedVersion */ @Schema(name = "expectedVersion", description = "期望当前 active 版本,用于乐观锁", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("expectedVersion") public @Nullable Integer getExpectedVersion() { return expectedVersion; } @JsonProperty("expectedVersion") public void setExpectedVersion(@Nullable Integer expectedVersion) { this.expectedVersion = expectedVersion; } public MetaSchemaDraftRequest displayName(@Nullable String displayName) { this.displayName = displayName; return this; } /** * 显示名称 * @return displayName */ @Schema(name = "displayName", description = "显示名称", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("displayName") public @Nullable String getDisplayName() { return displayName; } @JsonProperty("displayName") public void setDisplayName(@Nullable String displayName) { this.displayName = displayName; } public MetaSchemaDraftRequest description(@Nullable String description) { this.description = description; return this; } /** * Get description * @return description */ @Schema(name = "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 MetaSchemaDraftRequest fields(List<@Valid MetaField> fields) { this.fields = fields; return this; } public MetaSchemaDraftRequest addFieldsItem(MetaField fieldsItem) { if (this.fields == null) { this.fields = new ArrayList<>(); } this.fields.add(fieldsItem); return this; } /** * 完整字段定义(全量替换) * @return fields */ @Valid @Schema(name = "fields", description = "完整字段定义(全量替换)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("fields") public List<@Valid MetaField> getFields() { return fields; } @JsonProperty("fields") public void setFields(List<@Valid MetaField> fields) { this.fields = fields; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } MetaSchemaDraftRequest metaSchemaDraftRequest = (MetaSchemaDraftRequest) o; return Objects.equals(this.commandId, metaSchemaDraftRequest.commandId) && Objects.equals(this.expectedVersion, metaSchemaDraftRequest.expectedVersion) && Objects.equals(this.displayName, metaSchemaDraftRequest.displayName) && Objects.equals(this.description, metaSchemaDraftRequest.description) && Objects.equals(this.fields, metaSchemaDraftRequest.fields); } @Override public int hashCode() { return Objects.hash(commandId, expectedVersion, displayName, description, fields); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class MetaSchemaDraftRequest {\n"); sb.append(" commandId: ").append(toIndentedString(commandId)).append("\n"); sb.append(" expectedVersion: ").append(toIndentedString(expectedVersion)).append("\n"); sb.append(" displayName: ").append(toIndentedString(displayName)).append("\n"); sb.append(" description: ").append(toIndentedString(description)).append("\n"); sb.append(" fields: ").append(toIndentedString(fields)).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 "); } }