/*
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 * in compliance with the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License
 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 * or implied. See the License for the specific language governing permissions and limitations under
 * the License.
 */
/*
 * This code was generated by https://github.com/googleapis/google-api-java-client-services/
 * Modify at your own risk.
 */

package com.google.api.services.ml.v1.model;

/**
 * Represents results of a training job. Output only.
 *
 * <p> This is the Java data model class that specifies how to parse/serialize into the JSON that is
 * transmitted over HTTP when working with the AI Platform Training & Prediction API. For a detailed
 * explanation see:
 * <a href="https://developers.google.com/api-client-library/java/google-http-java-client/json">https://developers.google.com/api-client-library/java/google-http-java-client/json</a>
 * </p>
 *
 * @author Google, Inc.
 */
@SuppressWarnings("javadoc")
public final class GoogleCloudMlV1TrainingOutput extends com.google.api.client.json.GenericJson {

  /**
   * Details related to built-in algorithms jobs. Only set for built-in algorithms jobs.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private GoogleCloudMlV1BuiltInAlgorithmOutput builtInAlgorithmOutput;

  /**
   * The number of hyperparameter tuning trials that completed successfully. Only set for
   * hyperparameter tuning jobs.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key @com.google.api.client.json.JsonString
  private java.lang.Long completedTrialCount;

  /**
   * The amount of ML units consumed by the job.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.Double consumedMLUnits;

  /**
   * The TensorFlow summary tag name used for optimizing hyperparameter tuning trials. See [`Hyperpa
   * rameterSpec.hyperparameterMetricTag`](#HyperparameterSpec.FIELDS.hyperparameter_metric_tag) for
   * more information. Only set for hyperparameter tuning jobs.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String hyperparameterMetricTag;

  /**
   * Whether this job is a built-in Algorithm job.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.Boolean isBuiltInAlgorithmJob;

  /**
   * Whether this job is a hyperparameter tuning job.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.Boolean isHyperparameterTuningJob;

  /**
   * Results for individual Hyperparameter trials. Only set for hyperparameter tuning jobs.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.util.List<GoogleCloudMlV1HyperparameterOutput> trials;

  static {
    // hack to force ProGuard to consider GoogleCloudMlV1HyperparameterOutput used, since otherwise it would be stripped out
    // see https://github.com/google/google-api-java-client/issues/543
    com.google.api.client.util.Data.nullOf(GoogleCloudMlV1HyperparameterOutput.class);
  }

  /**
   * Details related to built-in algorithms jobs. Only set for built-in algorithms jobs.
   * @return value or {@code null} for none
   */
  public GoogleCloudMlV1BuiltInAlgorithmOutput getBuiltInAlgorithmOutput() {
    return builtInAlgorithmOutput;
  }

  /**
   * Details related to built-in algorithms jobs. Only set for built-in algorithms jobs.
   * @param builtInAlgorithmOutput builtInAlgorithmOutput or {@code null} for none
   */
  public GoogleCloudMlV1TrainingOutput setBuiltInAlgorithmOutput(GoogleCloudMlV1BuiltInAlgorithmOutput builtInAlgorithmOutput) {
    this.builtInAlgorithmOutput = builtInAlgorithmOutput;
    return this;
  }

  /**
   * The number of hyperparameter tuning trials that completed successfully. Only set for
   * hyperparameter tuning jobs.
   * @return value or {@code null} for none
   */
  public java.lang.Long getCompletedTrialCount() {
    return completedTrialCount;
  }

  /**
   * The number of hyperparameter tuning trials that completed successfully. Only set for
   * hyperparameter tuning jobs.
   * @param completedTrialCount completedTrialCount or {@code null} for none
   */
  public GoogleCloudMlV1TrainingOutput setCompletedTrialCount(java.lang.Long completedTrialCount) {
    this.completedTrialCount = completedTrialCount;
    return this;
  }

  /**
   * The amount of ML units consumed by the job.
   * @return value or {@code null} for none
   */
  public java.lang.Double getConsumedMLUnits() {
    return consumedMLUnits;
  }

  /**
   * The amount of ML units consumed by the job.
   * @param consumedMLUnits consumedMLUnits or {@code null} for none
   */
  public GoogleCloudMlV1TrainingOutput setConsumedMLUnits(java.lang.Double consumedMLUnits) {
    this.consumedMLUnits = consumedMLUnits;
    return this;
  }

  /**
   * The TensorFlow summary tag name used for optimizing hyperparameter tuning trials. See [`Hyperpa
   * rameterSpec.hyperparameterMetricTag`](#HyperparameterSpec.FIELDS.hyperparameter_metric_tag) for
   * more information. Only set for hyperparameter tuning jobs.
   * @return value or {@code null} for none
   */
  public java.lang.String getHyperparameterMetricTag() {
    return hyperparameterMetricTag;
  }

  /**
   * The TensorFlow summary tag name used for optimizing hyperparameter tuning trials. See [`Hyperpa
   * rameterSpec.hyperparameterMetricTag`](#HyperparameterSpec.FIELDS.hyperparameter_metric_tag) for
   * more information. Only set for hyperparameter tuning jobs.
   * @param hyperparameterMetricTag hyperparameterMetricTag or {@code null} for none
   */
  public GoogleCloudMlV1TrainingOutput setHyperparameterMetricTag(java.lang.String hyperparameterMetricTag) {
    this.hyperparameterMetricTag = hyperparameterMetricTag;
    return this;
  }

  /**
   * Whether this job is a built-in Algorithm job.
   * @return value or {@code null} for none
   */
  public java.lang.Boolean getIsBuiltInAlgorithmJob() {
    return isBuiltInAlgorithmJob;
  }

  /**
   * Whether this job is a built-in Algorithm job.
   * @param isBuiltInAlgorithmJob isBuiltInAlgorithmJob or {@code null} for none
   */
  public GoogleCloudMlV1TrainingOutput setIsBuiltInAlgorithmJob(java.lang.Boolean isBuiltInAlgorithmJob) {
    this.isBuiltInAlgorithmJob = isBuiltInAlgorithmJob;
    return this;
  }

  /**
   * Whether this job is a hyperparameter tuning job.
   * @return value or {@code null} for none
   */
  public java.lang.Boolean getIsHyperparameterTuningJob() {
    return isHyperparameterTuningJob;
  }

  /**
   * Whether this job is a hyperparameter tuning job.
   * @param isHyperparameterTuningJob isHyperparameterTuningJob or {@code null} for none
   */
  public GoogleCloudMlV1TrainingOutput setIsHyperparameterTuningJob(java.lang.Boolean isHyperparameterTuningJob) {
    this.isHyperparameterTuningJob = isHyperparameterTuningJob;
    return this;
  }

  /**
   * Results for individual Hyperparameter trials. Only set for hyperparameter tuning jobs.
   * @return value or {@code null} for none
   */
  public java.util.List<GoogleCloudMlV1HyperparameterOutput> getTrials() {
    return trials;
  }

  /**
   * Results for individual Hyperparameter trials. Only set for hyperparameter tuning jobs.
   * @param trials trials or {@code null} for none
   */
  public GoogleCloudMlV1TrainingOutput setTrials(java.util.List<GoogleCloudMlV1HyperparameterOutput> trials) {
    this.trials = trials;
    return this;
  }

  @Override
  public GoogleCloudMlV1TrainingOutput set(String fieldName, Object value) {
    return (GoogleCloudMlV1TrainingOutput) super.set(fieldName, value);
  }

  @Override
  public GoogleCloudMlV1TrainingOutput clone() {
    return (GoogleCloudMlV1TrainingOutput) super.clone();
  }

}
