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

com.dominodatalab.pub.model.RemoteMetric Maven / Gradle / Ivy

Go to download

Domino Data Lab API Client to connect to Domino web services using Java HTTP Client.

There is a newer version: 6.0.1.0
Show newest version
/*
 * Domino Public API
 * Domino Public API Endpoints
 *
 * The version of the OpenAPI document: 0.0.0
 * 
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */


package com.dominodatalab.pub.model;

import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.StringJoiner;
import java.util.Objects;
import java.util.Map;
import java.util.HashMap;
import com.dominodatalab.pub.model.RemoteModelDetail;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import java.time.OffsetDateTime;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;


import com.dominodatalab.pub.invoker.ApiClient;
/**
 * RemoteMetric
 */
@JsonPropertyOrder({
  RemoteMetric.JSON_PROPERTY_DATA_POINTS,
  RemoteMetric.JSON_PROPERTY_ENDING_TIMESTAMP,
  RemoteMetric.JSON_PROPERTY_MODEL_DATA_POINTS,
  RemoteMetric.JSON_PROPERTY_STARTING_TIMESTAMP,
  RemoteMetric.JSON_PROPERTY_WINDOW
})
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-04T16:37:28.765500600-04:00[America/New_York]", comments = "Generator version: 7.8.0")
public class RemoteMetric {
  public static final String JSON_PROPERTY_DATA_POINTS = "dataPoints";
  private List dataPoints = new ArrayList<>();

  public static final String JSON_PROPERTY_ENDING_TIMESTAMP = "endingTimestamp";
  private OffsetDateTime endingTimestamp;

  public static final String JSON_PROPERTY_MODEL_DATA_POINTS = "modelDataPoints";
  private List modelDataPoints = new ArrayList<>();

  public static final String JSON_PROPERTY_STARTING_TIMESTAMP = "startingTimestamp";
  private OffsetDateTime startingTimestamp;

  public static final String JSON_PROPERTY_WINDOW = "window";
  private String window;

  public RemoteMetric() { 
  }

  public RemoteMetric dataPoints(List dataPoints) {
    this.dataPoints = dataPoints;
    return this;
  }

  public RemoteMetric addDataPointsItem(String dataPointsItem) {
    if (this.dataPoints == null) {
      this.dataPoints = new ArrayList<>();
    }
    this.dataPoints.add(dataPointsItem);
    return this;
  }

  /**
   * Get dataPoints
   * @return dataPoints
   */
  @javax.annotation.Nonnull
  @JsonProperty(JSON_PROPERTY_DATA_POINTS)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public List getDataPoints() {
    return dataPoints;
  }


  @JsonProperty(JSON_PROPERTY_DATA_POINTS)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setDataPoints(List dataPoints) {
    this.dataPoints = dataPoints;
  }


  public RemoteMetric endingTimestamp(OffsetDateTime endingTimestamp) {
    this.endingTimestamp = endingTimestamp;
    return this;
  }

  /**
   * Get endingTimestamp
   * @return endingTimestamp
   */
  @javax.annotation.Nonnull
  @JsonProperty(JSON_PROPERTY_ENDING_TIMESTAMP)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public OffsetDateTime getEndingTimestamp() {
    return endingTimestamp;
  }


  @JsonProperty(JSON_PROPERTY_ENDING_TIMESTAMP)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setEndingTimestamp(OffsetDateTime endingTimestamp) {
    this.endingTimestamp = endingTimestamp;
  }


  public RemoteMetric modelDataPoints(List modelDataPoints) {
    this.modelDataPoints = modelDataPoints;
    return this;
  }

  public RemoteMetric addModelDataPointsItem(RemoteModelDetail modelDataPointsItem) {
    if (this.modelDataPoints == null) {
      this.modelDataPoints = new ArrayList<>();
    }
    this.modelDataPoints.add(modelDataPointsItem);
    return this;
  }

  /**
   * Get modelDataPoints
   * @return modelDataPoints
   */
  @javax.annotation.Nonnull
  @JsonProperty(JSON_PROPERTY_MODEL_DATA_POINTS)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public List getModelDataPoints() {
    return modelDataPoints;
  }


  @JsonProperty(JSON_PROPERTY_MODEL_DATA_POINTS)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setModelDataPoints(List modelDataPoints) {
    this.modelDataPoints = modelDataPoints;
  }


  public RemoteMetric startingTimestamp(OffsetDateTime startingTimestamp) {
    this.startingTimestamp = startingTimestamp;
    return this;
  }

  /**
   * Get startingTimestamp
   * @return startingTimestamp
   */
  @javax.annotation.Nonnull
  @JsonProperty(JSON_PROPERTY_STARTING_TIMESTAMP)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public OffsetDateTime getStartingTimestamp() {
    return startingTimestamp;
  }


  @JsonProperty(JSON_PROPERTY_STARTING_TIMESTAMP)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setStartingTimestamp(OffsetDateTime startingTimestamp) {
    this.startingTimestamp = startingTimestamp;
  }


  public RemoteMetric window(String window) {
    this.window = window;
    return this;
  }

  /**
   * Get window
   * @return window
   */
  @javax.annotation.Nonnull
  @JsonProperty(JSON_PROPERTY_WINDOW)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public String getWindow() {
    return window;
  }


  @JsonProperty(JSON_PROPERTY_WINDOW)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setWindow(String window) {
    this.window = window;
  }


  /**
   * Return true if this RemoteMetric object is equal to o.
   */
  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    RemoteMetric remoteMetric = (RemoteMetric) o;
    return Objects.equals(this.dataPoints, remoteMetric.dataPoints) &&
        Objects.equals(this.endingTimestamp, remoteMetric.endingTimestamp) &&
        Objects.equals(this.modelDataPoints, remoteMetric.modelDataPoints) &&
        Objects.equals(this.startingTimestamp, remoteMetric.startingTimestamp) &&
        Objects.equals(this.window, remoteMetric.window);
  }

  @Override
  public int hashCode() {
    return Objects.hash(dataPoints, endingTimestamp, modelDataPoints, startingTimestamp, window);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class RemoteMetric {\n");
    sb.append("    dataPoints: ").append(toIndentedString(dataPoints)).append("\n");
    sb.append("    endingTimestamp: ").append(toIndentedString(endingTimestamp)).append("\n");
    sb.append("    modelDataPoints: ").append(toIndentedString(modelDataPoints)).append("\n");
    sb.append("    startingTimestamp: ").append(toIndentedString(startingTimestamp)).append("\n");
    sb.append("    window: ").append(toIndentedString(window)).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    ");
  }

  /**
   * Convert the instance into URL query string.
   *
   * @return URL query string
   */
  public String toUrlQueryString() {
    return toUrlQueryString(null);
  }

  /**
   * Convert the instance into URL query string.
   *
   * @param prefix prefix of the query string
   * @return URL query string
   */
  public String toUrlQueryString(String prefix) {
    String suffix = "";
    String containerSuffix = "";
    String containerPrefix = "";
    if (prefix == null) {
      // style=form, explode=true, e.g. /pet?name=cat&type=manx
      prefix = "";
    } else {
      // deepObject style e.g. /pet?id[name]=cat&id[type]=manx
      prefix = prefix + "[";
      suffix = "]";
      containerSuffix = "]";
      containerPrefix = "[";
    }

    StringJoiner joiner = new StringJoiner("&");

    // add `dataPoints` to the URL query string
    if (getDataPoints() != null) {
      for (int i = 0; i < getDataPoints().size(); i++) {
        joiner.add(String.format("%sdataPoints%s%s=%s", prefix, suffix,
            "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix),
            URLEncoder.encode(ApiClient.valueToString(getDataPoints().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
      }
    }

    // add `endingTimestamp` to the URL query string
    if (getEndingTimestamp() != null) {
      joiner.add(String.format("%sendingTimestamp%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getEndingTimestamp()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
    }

    // add `modelDataPoints` to the URL query string
    if (getModelDataPoints() != null) {
      for (int i = 0; i < getModelDataPoints().size(); i++) {
        if (getModelDataPoints().get(i) != null) {
          joiner.add(getModelDataPoints().get(i).toUrlQueryString(String.format("%smodelDataPoints%s%s", prefix, suffix,
          "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix))));
        }
      }
    }

    // add `startingTimestamp` to the URL query string
    if (getStartingTimestamp() != null) {
      joiner.add(String.format("%sstartingTimestamp%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getStartingTimestamp()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
    }

    // add `window` to the URL query string
    if (getWindow() != null) {
      joiner.add(String.format("%swindow%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getWindow()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
    }

    return joiner.toString();
  }
}





© 2015 - 2025 Weber Informatics LLC | Privacy Policy