All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.camunda.zeebe.management.cluster.TopologyChange Maven / Gradle / Ivy

There is a newer version: 8.7.0-alpha1
Show newest version
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 io.camunda.zeebe.management.cluster.Operation;
import io.camunda.zeebe.management.cluster.TopologyChangeCompletedInner;
import java.time.OffsetDateTime;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
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;

/**
 * TopologyChange
 */
@com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL)

@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-09-24T12:12:47.003563022Z[GMT]", comments = "Generator version: 7.8.0")
public class TopologyChange {

  private Long id;

  /**
   * Gets or Sets status
   */
  public enum StatusEnum {
    IN_PROGRESS("IN_PROGRESS"),
    
    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;

  private Long internalVersion;

  @Valid
  private List completed = new ArrayList<>();

  @Valid
  private List<@Valid Operation> pending = new ArrayList<>();

  public TopologyChange 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 TopologyChange 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 TopologyChange 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 TopologyChange 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;
  }

  public TopologyChange internalVersion(Long internalVersion) {
    this.internalVersion = internalVersion;
    return this;
  }

  /**
   * The internal version of the topology change
   * @return internalVersion
   */
  
  @Schema(name = "internalVersion", example = "1", description = "The internal version of the topology change", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
  @JsonProperty("internalVersion")
  public Long getInternalVersion() {
    return internalVersion;
  }

  public void setInternalVersion(Long internalVersion) {
    this.internalVersion = internalVersion;
  }

  public TopologyChange completed(List completed) {
    this.completed = completed;
    return this;
  }

  public TopologyChange addCompletedItem(TopologyChangeCompletedInner completedItem) {
    if (this.completed == null) {
      this.completed = new ArrayList<>();
    }
    this.completed.add(completedItem);
    return this;
  }

  /**
   * The list of operations that have been completed if the change status is not COMPLETED.
   * @return completed
   */
  @Valid 
  @Schema(name = "completed", description = "The list of operations that have been completed if the change status is not COMPLETED.", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
  @JsonProperty("completed")
  public List getCompleted() {
    return completed;
  }

  public void setCompleted(List completed) {
    this.completed = completed;
  }

  public TopologyChange pending(List<@Valid Operation> pending) {
    this.pending = pending;
    return this;
  }

  public TopologyChange addPendingItem(Operation pendingItem) {
    if (this.pending == null) {
      this.pending = new ArrayList<>();
    }
    this.pending.add(pendingItem);
    return this;
  }

  /**
   * The list of operations that are pending.
   * @return pending
   */
  @Valid 
  @Schema(name = "pending", description = "The list of operations that are pending.", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
  @JsonProperty("pending")
  public List<@Valid Operation> getPending() {
    return pending;
  }

  public void setPending(List<@Valid Operation> pending) {
    this.pending = pending;
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    TopologyChange topologyChange = (TopologyChange) o;
    return Objects.equals(this.id, topologyChange.id) &&
        Objects.equals(this.status, topologyChange.status) &&
        Objects.equals(this.startedAt, topologyChange.startedAt) &&
        Objects.equals(this.completedAt, topologyChange.completedAt) &&
        Objects.equals(this.internalVersion, topologyChange.internalVersion) &&
        Objects.equals(this.completed, topologyChange.completed) &&
        Objects.equals(this.pending, topologyChange.pending);
  }

  @Override
  public int hashCode() {
    return Objects.hash(id, status, startedAt, completedAt, internalVersion, completed, pending);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class TopologyChange {\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("    internalVersion: ").append(toIndentedString(internalVersion)).append("\n");
    sb.append("    completed: ").append(toIndentedString(completed)).append("\n");
    sb.append("    pending: ").append(toIndentedString(pending)).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    ");
  }
}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy