411 lines
11 KiB
Java
411 lines
11 KiB
Java
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.MetaField;
|
|
import com.muse.dto.MetaSchemaPublishRecord;
|
|
import com.muse.dto.MetaSchemaVersionDiff;
|
|
import java.time.OffsetDateTime;
|
|
import java.util.ArrayList;
|
|
import java.util.Arrays;
|
|
import java.util.List;
|
|
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;
|
|
|
|
/**
|
|
* MetaSchemaVersionDetail
|
|
*/
|
|
|
|
@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 MetaSchemaVersionDetail implements Serializable {
|
|
|
|
private static final long serialVersionUID = 1L;
|
|
|
|
private String schemaKey;
|
|
|
|
private Integer version;
|
|
|
|
/**
|
|
* Gets or Sets status
|
|
*/
|
|
public enum StatusEnum {
|
|
DRAFT("draft"),
|
|
|
|
PUBLISHED("published"),
|
|
|
|
ACTIVE("active"),
|
|
|
|
DEPRECATED("deprecated"),
|
|
|
|
ARCHIVED("archived");
|
|
|
|
private final String value;
|
|
|
|
StatusEnum(String value) {
|
|
this.value = value;
|
|
}
|
|
|
|
@JsonValue
|
|
public String getValue() {
|
|
return value;
|
|
}
|
|
|
|
@Override
|
|
public String toString() {
|
|
return String.valueOf(value);
|
|
}
|
|
|
|
@JsonCreator
|
|
public static StatusEnum fromValue(String value) {
|
|
for (StatusEnum b : StatusEnum.values()) {
|
|
if (b.value.equals(value)) {
|
|
return b;
|
|
}
|
|
}
|
|
throw new IllegalArgumentException("Unexpected value '" + value + "'");
|
|
}
|
|
}
|
|
|
|
private StatusEnum status;
|
|
|
|
@Valid
|
|
private List<@Valid MetaField> fields = new ArrayList<>();
|
|
|
|
private @Nullable MetaSchemaVersionDiff fieldDiff;
|
|
|
|
private @Nullable MetaSchemaPublishRecord publishRecord;
|
|
|
|
@DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
|
|
private @Nullable OffsetDateTime publishedAt;
|
|
|
|
private @Nullable String publishedBy;
|
|
|
|
@DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
|
|
private @Nullable OffsetDateTime activatedAt;
|
|
|
|
@DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
|
|
private @Nullable OffsetDateTime deprecatedAt;
|
|
|
|
@DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
|
|
private @Nullable OffsetDateTime createdAt;
|
|
|
|
public MetaSchemaVersionDetail() {
|
|
super();
|
|
}
|
|
|
|
/**
|
|
* Constructor with only required parameters
|
|
*/
|
|
public MetaSchemaVersionDetail(String schemaKey, Integer version, StatusEnum status) {
|
|
this.schemaKey = schemaKey;
|
|
this.version = version;
|
|
this.status = status;
|
|
}
|
|
|
|
public MetaSchemaVersionDetail schemaKey(String schemaKey) {
|
|
this.schemaKey = schemaKey;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* Get schemaKey
|
|
* @return schemaKey
|
|
*/
|
|
@NotNull
|
|
@Schema(name = "schemaKey", requiredMode = Schema.RequiredMode.REQUIRED)
|
|
@JsonProperty("schemaKey")
|
|
public String getSchemaKey() {
|
|
return schemaKey;
|
|
}
|
|
|
|
@JsonProperty("schemaKey")
|
|
public void setSchemaKey(String schemaKey) {
|
|
this.schemaKey = schemaKey;
|
|
}
|
|
|
|
public MetaSchemaVersionDetail version(Integer version) {
|
|
this.version = version;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* Get version
|
|
* @return version
|
|
*/
|
|
@NotNull
|
|
@Schema(name = "version", requiredMode = Schema.RequiredMode.REQUIRED)
|
|
@JsonProperty("version")
|
|
public Integer getVersion() {
|
|
return version;
|
|
}
|
|
|
|
@JsonProperty("version")
|
|
public void setVersion(Integer version) {
|
|
this.version = version;
|
|
}
|
|
|
|
public MetaSchemaVersionDetail status(StatusEnum status) {
|
|
this.status = status;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* Get status
|
|
* @return status
|
|
*/
|
|
@NotNull
|
|
@Schema(name = "status", requiredMode = Schema.RequiredMode.REQUIRED)
|
|
@JsonProperty("status")
|
|
public StatusEnum getStatus() {
|
|
return status;
|
|
}
|
|
|
|
@JsonProperty("status")
|
|
public void setStatus(StatusEnum status) {
|
|
this.status = status;
|
|
}
|
|
|
|
public MetaSchemaVersionDetail fields(List<@Valid MetaField> fields) {
|
|
this.fields = fields;
|
|
return this;
|
|
}
|
|
|
|
public MetaSchemaVersionDetail addFieldsItem(MetaField fieldsItem) {
|
|
if (this.fields == null) {
|
|
this.fields = new ArrayList<>();
|
|
}
|
|
this.fields.add(fieldsItem);
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* Get fields
|
|
* @return fields
|
|
*/
|
|
@Valid
|
|
@Schema(name = "fields", 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;
|
|
}
|
|
|
|
public MetaSchemaVersionDetail fieldDiff(@Nullable MetaSchemaVersionDiff fieldDiff) {
|
|
this.fieldDiff = fieldDiff;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* Get fieldDiff
|
|
* @return fieldDiff
|
|
*/
|
|
@Valid
|
|
@Schema(name = "fieldDiff", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
|
@JsonProperty("fieldDiff")
|
|
public @Nullable MetaSchemaVersionDiff getFieldDiff() {
|
|
return fieldDiff;
|
|
}
|
|
|
|
@JsonProperty("fieldDiff")
|
|
public void setFieldDiff(@Nullable MetaSchemaVersionDiff fieldDiff) {
|
|
this.fieldDiff = fieldDiff;
|
|
}
|
|
|
|
public MetaSchemaVersionDetail publishRecord(@Nullable MetaSchemaPublishRecord publishRecord) {
|
|
this.publishRecord = publishRecord;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* Get publishRecord
|
|
* @return publishRecord
|
|
*/
|
|
@Valid
|
|
@Schema(name = "publishRecord", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
|
@JsonProperty("publishRecord")
|
|
public @Nullable MetaSchemaPublishRecord getPublishRecord() {
|
|
return publishRecord;
|
|
}
|
|
|
|
@JsonProperty("publishRecord")
|
|
public void setPublishRecord(@Nullable MetaSchemaPublishRecord publishRecord) {
|
|
this.publishRecord = publishRecord;
|
|
}
|
|
|
|
public MetaSchemaVersionDetail publishedAt(@Nullable OffsetDateTime publishedAt) {
|
|
this.publishedAt = publishedAt;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* Get publishedAt
|
|
* @return publishedAt
|
|
*/
|
|
@Valid
|
|
@Schema(name = "publishedAt", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
|
@JsonProperty("publishedAt")
|
|
public @Nullable OffsetDateTime getPublishedAt() {
|
|
return publishedAt;
|
|
}
|
|
|
|
@JsonProperty("publishedAt")
|
|
public void setPublishedAt(@Nullable OffsetDateTime publishedAt) {
|
|
this.publishedAt = publishedAt;
|
|
}
|
|
|
|
public MetaSchemaVersionDetail publishedBy(@Nullable String publishedBy) {
|
|
this.publishedBy = publishedBy;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* 发布操作者
|
|
* @return publishedBy
|
|
*/
|
|
|
|
@Schema(name = "publishedBy", description = "发布操作者", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
|
@JsonProperty("publishedBy")
|
|
public @Nullable String getPublishedBy() {
|
|
return publishedBy;
|
|
}
|
|
|
|
@JsonProperty("publishedBy")
|
|
public void setPublishedBy(@Nullable String publishedBy) {
|
|
this.publishedBy = publishedBy;
|
|
}
|
|
|
|
public MetaSchemaVersionDetail activatedAt(@Nullable OffsetDateTime activatedAt) {
|
|
this.activatedAt = activatedAt;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* Get activatedAt
|
|
* @return activatedAt
|
|
*/
|
|
@Valid
|
|
@Schema(name = "activatedAt", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
|
@JsonProperty("activatedAt")
|
|
public @Nullable OffsetDateTime getActivatedAt() {
|
|
return activatedAt;
|
|
}
|
|
|
|
@JsonProperty("activatedAt")
|
|
public void setActivatedAt(@Nullable OffsetDateTime activatedAt) {
|
|
this.activatedAt = activatedAt;
|
|
}
|
|
|
|
public MetaSchemaVersionDetail deprecatedAt(@Nullable OffsetDateTime deprecatedAt) {
|
|
this.deprecatedAt = deprecatedAt;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* Get deprecatedAt
|
|
* @return deprecatedAt
|
|
*/
|
|
@Valid
|
|
@Schema(name = "deprecatedAt", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
|
@JsonProperty("deprecatedAt")
|
|
public @Nullable OffsetDateTime getDeprecatedAt() {
|
|
return deprecatedAt;
|
|
}
|
|
|
|
@JsonProperty("deprecatedAt")
|
|
public void setDeprecatedAt(@Nullable OffsetDateTime deprecatedAt) {
|
|
this.deprecatedAt = deprecatedAt;
|
|
}
|
|
|
|
public MetaSchemaVersionDetail createdAt(@Nullable OffsetDateTime createdAt) {
|
|
this.createdAt = createdAt;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* Get createdAt
|
|
* @return createdAt
|
|
*/
|
|
@Valid
|
|
@Schema(name = "createdAt", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
|
@JsonProperty("createdAt")
|
|
public @Nullable OffsetDateTime getCreatedAt() {
|
|
return createdAt;
|
|
}
|
|
|
|
@JsonProperty("createdAt")
|
|
public void setCreatedAt(@Nullable OffsetDateTime createdAt) {
|
|
this.createdAt = createdAt;
|
|
}
|
|
|
|
@Override
|
|
public boolean equals(Object o) {
|
|
if (this == o) {
|
|
return true;
|
|
}
|
|
if (o == null || getClass() != o.getClass()) {
|
|
return false;
|
|
}
|
|
MetaSchemaVersionDetail metaSchemaVersionDetail = (MetaSchemaVersionDetail) o;
|
|
return Objects.equals(this.schemaKey, metaSchemaVersionDetail.schemaKey) &&
|
|
Objects.equals(this.version, metaSchemaVersionDetail.version) &&
|
|
Objects.equals(this.status, metaSchemaVersionDetail.status) &&
|
|
Objects.equals(this.fields, metaSchemaVersionDetail.fields) &&
|
|
Objects.equals(this.fieldDiff, metaSchemaVersionDetail.fieldDiff) &&
|
|
Objects.equals(this.publishRecord, metaSchemaVersionDetail.publishRecord) &&
|
|
Objects.equals(this.publishedAt, metaSchemaVersionDetail.publishedAt) &&
|
|
Objects.equals(this.publishedBy, metaSchemaVersionDetail.publishedBy) &&
|
|
Objects.equals(this.activatedAt, metaSchemaVersionDetail.activatedAt) &&
|
|
Objects.equals(this.deprecatedAt, metaSchemaVersionDetail.deprecatedAt) &&
|
|
Objects.equals(this.createdAt, metaSchemaVersionDetail.createdAt);
|
|
}
|
|
|
|
@Override
|
|
public int hashCode() {
|
|
return Objects.hash(schemaKey, version, status, fields, fieldDiff, publishRecord, publishedAt, publishedBy, activatedAt, deprecatedAt, createdAt);
|
|
}
|
|
|
|
@Override
|
|
public String toString() {
|
|
StringBuilder sb = new StringBuilder();
|
|
sb.append("class MetaSchemaVersionDetail {\n");
|
|
sb.append(" schemaKey: ").append(toIndentedString(schemaKey)).append("\n");
|
|
sb.append(" version: ").append(toIndentedString(version)).append("\n");
|
|
sb.append(" status: ").append(toIndentedString(status)).append("\n");
|
|
sb.append(" fields: ").append(toIndentedString(fields)).append("\n");
|
|
sb.append(" fieldDiff: ").append(toIndentedString(fieldDiff)).append("\n");
|
|
sb.append(" publishRecord: ").append(toIndentedString(publishRecord)).append("\n");
|
|
sb.append(" publishedAt: ").append(toIndentedString(publishedAt)).append("\n");
|
|
sb.append(" publishedBy: ").append(toIndentedString(publishedBy)).append("\n");
|
|
sb.append(" activatedAt: ").append(toIndentedString(activatedAt)).append("\n");
|
|
sb.append(" deprecatedAt: ").append(toIndentedString(deprecatedAt)).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 ");
|
|
}
|
|
}
|
|
|