io.camunda.zeebe.management.cluster.PlannedOperationsResponse 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 io.camunda.zeebe.management.cluster.BrokerState;
import io.camunda.zeebe.management.cluster.Operation;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
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;
/**
* Returns the current topology, planned changes and the expected final topology when the planned changes have completed.
*/
@com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL)
@Schema(name = "PlannedOperationsResponse", description = "Returns the current topology, planned changes and the expected final topology when the planned changes have completed.")
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-10-02T11:21:27.419777225Z[GMT]", comments = "Generator version: 7.8.0")
public class PlannedOperationsResponse {
private Long changeId;
@Valid
private List<@Valid BrokerState> currentTopology = new ArrayList<>();
@Valid
private List<@Valid Operation> plannedChanges = new ArrayList<>();
@Valid
private List<@Valid BrokerState> expectedTopology = new ArrayList<>();
public PlannedOperationsResponse changeId(Long changeId) {
this.changeId = changeId;
return this;
}
/**
* The ID of a topology change operation
* @return changeId
*/
@Schema(name = "changeId", example = "8", description = "The ID of a topology change operation", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("changeId")
public Long getChangeId() {
return changeId;
}
public void setChangeId(Long changeId) {
this.changeId = changeId;
}
public PlannedOperationsResponse currentTopology(List<@Valid BrokerState> currentTopology) {
this.currentTopology = currentTopology;
return this;
}
public PlannedOperationsResponse addCurrentTopologyItem(BrokerState currentTopologyItem) {
if (this.currentTopology == null) {
this.currentTopology = new ArrayList<>();
}
this.currentTopology.add(currentTopologyItem);
return this;
}
/**
* Current topology of the cluster
* @return currentTopology
*/
@Valid
@Schema(name = "currentTopology", description = "Current topology of the cluster", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("currentTopology")
public List<@Valid BrokerState> getCurrentTopology() {
return currentTopology;
}
public void setCurrentTopology(List<@Valid BrokerState> currentTopology) {
this.currentTopology = currentTopology;
}
public PlannedOperationsResponse plannedChanges(List<@Valid Operation> plannedChanges) {
this.plannedChanges = plannedChanges;
return this;
}
public PlannedOperationsResponse addPlannedChangesItem(Operation plannedChangesItem) {
if (this.plannedChanges == null) {
this.plannedChanges = new ArrayList<>();
}
this.plannedChanges.add(plannedChangesItem);
return this;
}
/**
* A sequence of operations that will be performed to transform the current topology into the expected topology.
* @return plannedChanges
*/
@Valid
@Schema(name = "plannedChanges", description = "A sequence of operations that will be performed to transform the current topology into the expected topology.", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("plannedChanges")
public List<@Valid Operation> getPlannedChanges() {
return plannedChanges;
}
public void setPlannedChanges(List<@Valid Operation> plannedChanges) {
this.plannedChanges = plannedChanges;
}
public PlannedOperationsResponse expectedTopology(List<@Valid BrokerState> expectedTopology) {
this.expectedTopology = expectedTopology;
return this;
}
public PlannedOperationsResponse addExpectedTopologyItem(BrokerState expectedTopologyItem) {
if (this.expectedTopology == null) {
this.expectedTopology = new ArrayList<>();
}
this.expectedTopology.add(expectedTopologyItem);
return this;
}
/**
* The expected final topology when the planned changes have completed.
* @return expectedTopology
*/
@Valid
@Schema(name = "expectedTopology", description = "The expected final topology when the planned changes have completed.", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("expectedTopology")
public List<@Valid BrokerState> getExpectedTopology() {
return expectedTopology;
}
public void setExpectedTopology(List<@Valid BrokerState> expectedTopology) {
this.expectedTopology = expectedTopology;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
PlannedOperationsResponse plannedOperationsResponse = (PlannedOperationsResponse) o;
return Objects.equals(this.changeId, plannedOperationsResponse.changeId) &&
Objects.equals(this.currentTopology, plannedOperationsResponse.currentTopology) &&
Objects.equals(this.plannedChanges, plannedOperationsResponse.plannedChanges) &&
Objects.equals(this.expectedTopology, plannedOperationsResponse.expectedTopology);
}
@Override
public int hashCode() {
return Objects.hash(changeId, currentTopology, plannedChanges, expectedTopology);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class PlannedOperationsResponse {\n");
sb.append(" changeId: ").append(toIndentedString(changeId)).append("\n");
sb.append(" currentTopology: ").append(toIndentedString(currentTopology)).append("\n");
sb.append(" plannedChanges: ").append(toIndentedString(plannedChanges)).append("\n");
sb.append(" expectedTopology: ").append(toIndentedString(expectedTopology)).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 ");
}
}