io.camunda.zeebe.management.cluster.CompletedChange Maven / Gradle / Ivy
package io.camunda.zeebe.management.cluster;
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.openapitools.jackson.nullable.JsonNullable;
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;
/**
* CompletedChange
*/
@com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL)
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-10-02T11:21:26.842697815Z[GMT]", comments = "Generator version: 7.8.0")
public class CompletedChange {
private Long id;
/**
* Gets or Sets status
*/
public enum StatusEnum {
COMPLETED("COMPLETED"),
FAILED("FAILED"),
CANCELLED("CANCELLED");
private 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;
@DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
private OffsetDateTime startedAt;
@DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
private OffsetDateTime completedAt;
public CompletedChange id(Long id) {
this.id = id;
return this;
}
/**
* The ID of a topology change operation
* @return id
*/
@Schema(name = "id", example = "8", description = "The ID of a topology change operation", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("id")
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public CompletedChange status(StatusEnum status) {
this.status = status;
return this;
}
/**
* Get status
* @return status
*/
@Schema(name = "status", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("status")
public StatusEnum getStatus() {
return status;
}
public void setStatus(StatusEnum status) {
this.status = status;
}
public CompletedChange startedAt(OffsetDateTime startedAt) {
this.startedAt = startedAt;
return this;
}
/**
* The time when the topology change was started
* @return startedAt
*/
@Valid
@Schema(name = "startedAt", example = "2020-01-01T00:00Z", description = "The time when the topology change was started", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("startedAt")
public OffsetDateTime getStartedAt() {
return startedAt;
}
public void setStartedAt(OffsetDateTime startedAt) {
this.startedAt = startedAt;
}
public CompletedChange completedAt(OffsetDateTime completedAt) {
this.completedAt = completedAt;
return this;
}
/**
* The time when the topology change was completed
* @return completedAt
*/
@Valid
@Schema(name = "completedAt", example = "2020-01-01T00:00Z", description = "The time when the topology change was completed", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("completedAt")
public OffsetDateTime getCompletedAt() {
return completedAt;
}
public void setCompletedAt(OffsetDateTime completedAt) {
this.completedAt = completedAt;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
CompletedChange completedChange = (CompletedChange) o;
return Objects.equals(this.id, completedChange.id) &&
Objects.equals(this.status, completedChange.status) &&
Objects.equals(this.startedAt, completedChange.startedAt) &&
Objects.equals(this.completedAt, completedChange.completedAt);
}
@Override
public int hashCode() {
return Objects.hash(id, status, startedAt, completedAt);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class CompletedChange {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" status: ").append(toIndentedString(status)).append("\n");
sb.append(" startedAt: ").append(toIndentedString(startedAt)).append("\n");
sb.append(" completedAt: ").append(toIndentedString(completedAt)).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(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}