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

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

There is a newer version: 4.10.2
Show 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.ArrayList;
import java.util.List;
import java.util.Objects;

/** SourceWatchResponse */
public class SourceWatchResponse {

  @JsonProperty("runID")
  private String runID;

  @JsonProperty("data")
  private List data;

  @JsonProperty("events")
  private List events;

  @JsonProperty("message")
  private String message;

  public SourceWatchResponse setRunID(String runID) {
    this.runID = runID;
    return this;
  }

  /** Universally unique identifier (UUID) of a task run. */
  @javax.annotation.Nullable
  public String getRunID() {
    return runID;
  }

  public SourceWatchResponse setData(List data) {
    this.data = data;
    return this;
  }

  public SourceWatchResponse addData(Object dataItem) {
    if (this.data == null) {
      this.data = new ArrayList<>();
    }
    this.data.add(dataItem);
    return this;
  }

  /**
   * depending on the source type, the validation returns sampling data of your source (JSON, CSV,
   * BigQuery).
   */
  @javax.annotation.Nullable
  public List getData() {
    return data;
  }

  public SourceWatchResponse setEvents(List events) {
    this.events = events;
    return this;
  }

  public SourceWatchResponse addEvents(Event eventsItem) {
    if (this.events == null) {
      this.events = new ArrayList<>();
    }
    this.events.add(eventsItem);
    return this;
  }

  /** in case of error, observability events will be added to the response, if any. */
  @javax.annotation.Nullable
  public List getEvents() {
    return events;
  }

  public SourceWatchResponse setMessage(String message) {
    this.message = message;
    return this;
  }

  /** a message describing the outcome of a validate run. */
  @javax.annotation.Nonnull
  public String getMessage() {
    return message;
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    SourceWatchResponse sourceWatchResponse = (SourceWatchResponse) o;
    return (
      Objects.equals(this.runID, sourceWatchResponse.runID) &&
      Objects.equals(this.data, sourceWatchResponse.data) &&
      Objects.equals(this.events, sourceWatchResponse.events) &&
      Objects.equals(this.message, sourceWatchResponse.message)
    );
  }

  @Override
  public int hashCode() {
    return Objects.hash(runID, data, events, message);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class SourceWatchResponse {\n");
    sb.append("    runID: ").append(toIndentedString(runID)).append("\n");
    sb.append("    data: ").append(toIndentedString(data)).append("\n");
    sb.append("    events: ").append(toIndentedString(events)).append("\n");
    sb.append("    message: ").append(toIndentedString(message)).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    ");
  }
}