/*
 * 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.aiplatform.v1beta1.model;

/**
 * Model definition for
 * GoogleCloudAiplatformV1beta1SchemaTrainingjobDefinitionHyperparameterTuningJobSpec.
 *
 * <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 Vertex AI 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 GoogleCloudAiplatformV1beta1SchemaTrainingjobDefinitionHyperparameterTuningJobSpec extends com.google.api.client.json.GenericJson {

  /**
   * The number of failed Trials that need to be seen before failing the HyperparameterTuningJob. If
   * set to 0, Vertex AI decides how many Trials must fail before the whole job fails.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.Integer maxFailedTrialCount;

  /**
   * The desired total number of Trials.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.Integer maxTrialCount;

  /**
   * The desired number of Trials to run in parallel.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.Integer parallelTrialCount;

  /**
   * Study configuration of the HyperparameterTuningJob.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private GoogleCloudAiplatformV1beta1StudySpec studySpec;

  /**
   * The spec of a trial job. The same spec applies to the CustomJobs created in all the trials.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private GoogleCloudAiplatformV1beta1CustomJobSpec trialJobSpec;

  /**
   * The number of failed Trials that need to be seen before failing the HyperparameterTuningJob. If
   * set to 0, Vertex AI decides how many Trials must fail before the whole job fails.
   * @return value or {@code null} for none
   */
  public java.lang.Integer getMaxFailedTrialCount() {
    return maxFailedTrialCount;
  }

  /**
   * The number of failed Trials that need to be seen before failing the HyperparameterTuningJob. If
   * set to 0, Vertex AI decides how many Trials must fail before the whole job fails.
   * @param maxFailedTrialCount maxFailedTrialCount or {@code null} for none
   */
  public GoogleCloudAiplatformV1beta1SchemaTrainingjobDefinitionHyperparameterTuningJobSpec setMaxFailedTrialCount(java.lang.Integer maxFailedTrialCount) {
    this.maxFailedTrialCount = maxFailedTrialCount;
    return this;
  }

  /**
   * The desired total number of Trials.
   * @return value or {@code null} for none
   */
  public java.lang.Integer getMaxTrialCount() {
    return maxTrialCount;
  }

  /**
   * The desired total number of Trials.
   * @param maxTrialCount maxTrialCount or {@code null} for none
   */
  public GoogleCloudAiplatformV1beta1SchemaTrainingjobDefinitionHyperparameterTuningJobSpec setMaxTrialCount(java.lang.Integer maxTrialCount) {
    this.maxTrialCount = maxTrialCount;
    return this;
  }

  /**
   * The desired number of Trials to run in parallel.
   * @return value or {@code null} for none
   */
  public java.lang.Integer getParallelTrialCount() {
    return parallelTrialCount;
  }

  /**
   * The desired number of Trials to run in parallel.
   * @param parallelTrialCount parallelTrialCount or {@code null} for none
   */
  public GoogleCloudAiplatformV1beta1SchemaTrainingjobDefinitionHyperparameterTuningJobSpec setParallelTrialCount(java.lang.Integer parallelTrialCount) {
    this.parallelTrialCount = parallelTrialCount;
    return this;
  }

  /**
   * Study configuration of the HyperparameterTuningJob.
   * @return value or {@code null} for none
   */
  public GoogleCloudAiplatformV1beta1StudySpec getStudySpec() {
    return studySpec;
  }

  /**
   * Study configuration of the HyperparameterTuningJob.
   * @param studySpec studySpec or {@code null} for none
   */
  public GoogleCloudAiplatformV1beta1SchemaTrainingjobDefinitionHyperparameterTuningJobSpec setStudySpec(GoogleCloudAiplatformV1beta1StudySpec studySpec) {
    this.studySpec = studySpec;
    return this;
  }

  /**
   * The spec of a trial job. The same spec applies to the CustomJobs created in all the trials.
   * @return value or {@code null} for none
   */
  public GoogleCloudAiplatformV1beta1CustomJobSpec getTrialJobSpec() {
    return trialJobSpec;
  }

  /**
   * The spec of a trial job. The same spec applies to the CustomJobs created in all the trials.
   * @param trialJobSpec trialJobSpec or {@code null} for none
   */
  public GoogleCloudAiplatformV1beta1SchemaTrainingjobDefinitionHyperparameterTuningJobSpec setTrialJobSpec(GoogleCloudAiplatformV1beta1CustomJobSpec trialJobSpec) {
    this.trialJobSpec = trialJobSpec;
    return this;
  }

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

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

}
