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

com.algolia.model.ingestion.ScheduleTrigger Maven / Gradle / Ivy

The newest version!
// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost
// - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.

package com.algolia.model.ingestion;

import com.fasterxml.jackson.annotation.*;
import com.fasterxml.jackson.databind.annotation.*;
import java.util.Objects;

/** Trigger information for scheduled tasks. */
@JsonDeserialize(as = ScheduleTrigger.class)
public class ScheduleTrigger implements Trigger {

  @JsonProperty("type")
  private ScheduleTriggerType type;

  @JsonProperty("cron")
  private String cron;

  @JsonProperty("lastRun")
  private String lastRun;

  @JsonProperty("nextRun")
  private String nextRun;

  public ScheduleTrigger setType(ScheduleTriggerType type) {
    this.type = type;
    return this;
  }

  /** Get type */
  @javax.annotation.Nonnull
  public ScheduleTriggerType getType() {
    return type;
  }

  public ScheduleTrigger setCron(String cron) {
    this.cron = cron;
    return this;
  }

  /** Cron expression for the task's schedule. */
  @javax.annotation.Nonnull
  public String getCron() {
    return cron;
  }

  public ScheduleTrigger setLastRun(String lastRun) {
    this.lastRun = lastRun;
    return this;
  }

  /** The last time the scheduled task ran in RFC 3339 format. */
  @javax.annotation.Nullable
  public String getLastRun() {
    return lastRun;
  }

  public ScheduleTrigger setNextRun(String nextRun) {
    this.nextRun = nextRun;
    return this;
  }

  /** The next scheduled run of the task in RFC 3339 format. */
  @javax.annotation.Nonnull
  public String getNextRun() {
    return nextRun;
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    ScheduleTrigger scheduleTrigger = (ScheduleTrigger) o;
    return (
      Objects.equals(this.type, scheduleTrigger.type) &&
      Objects.equals(this.cron, scheduleTrigger.cron) &&
      Objects.equals(this.lastRun, scheduleTrigger.lastRun) &&
      Objects.equals(this.nextRun, scheduleTrigger.nextRun)
    );
  }

  @Override
  public int hashCode() {
    return Objects.hash(type, cron, lastRun, nextRun);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class ScheduleTrigger {\n");
    sb.append("    type: ").append(toIndentedString(type)).append("\n");
    sb.append("    cron: ").append(toIndentedString(cron)).append("\n");
    sb.append("    lastRun: ").append(toIndentedString(lastRun)).append("\n");
    sb.append("    nextRun: ").append(toIndentedString(nextRun)).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 - 2025 Weber Informatics LLC | Privacy Policy