/*
 * 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;

/**
 * Configuration for logging request-response pairs to a BigQuery table. Online prediction requests
 * to a model version and the responses to these requests are converted to raw strings and saved to
 * the specified BigQuery table. Logging is constrained by [BigQuery quotas and
 * limits](/bigquery/quotas). If your project exceeds BigQuery quotas or limits, AI Platform
 * Prediction does not log request-response pairs, but it continues to serve predictions.
 *
 * If you are using [continuous evaluation](/ml-engine/docs/continuous-evaluation/), you do not need
 * to specify this configuration manually. Setting up continuous evaluation automatically enables
 * logging of request-response pairs.
 *
 * <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 GoogleCloudMlV1RequestLoggingConfig extends com.google.api.client.json.GenericJson {

  /**
   * Required. Fully qualified BigQuery table name in the following format:
   * "project_id.dataset_name.table_name"
   *
   * The specifcied table must already exist, and the "Cloud ML Service Agent" for your project must
   * have permission to write to it. The table must have the following
   * [schema](/bigquery/docs/schemas):
   *
   *   Field nameType     Mode   modelSTRINGREQUIRED   model_versionSTRINGREQUIRED
   * timeTIMESTAMPREQUIRED   raw_dataSTRINGREQUIRED   raw_predictionSTRINGNULLABLE
   * groundtruthSTRINGNULLABLE
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String bigqueryTableName;

  /**
   * Percentage of requests to be logged, expressed as a fraction from 0 to 1. For example, if you
   * want to log 10% of requests, enter `0.1`. The sampling window is the lifetime of the model
   * version. Defaults to 0.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.Double samplingPercentage;

  /**
   * Required. Fully qualified BigQuery table name in the following format:
   * "project_id.dataset_name.table_name"
   *
   * The specifcied table must already exist, and the "Cloud ML Service Agent" for your project must
   * have permission to write to it. The table must have the following
   * [schema](/bigquery/docs/schemas):
   *
   *   Field nameType     Mode   modelSTRINGREQUIRED   model_versionSTRINGREQUIRED
   * timeTIMESTAMPREQUIRED   raw_dataSTRINGREQUIRED   raw_predictionSTRINGNULLABLE
   * groundtruthSTRINGNULLABLE
   * @return value or {@code null} for none
   */
  public java.lang.String getBigqueryTableName() {
    return bigqueryTableName;
  }

  /**
   * Required. Fully qualified BigQuery table name in the following format:
   * "project_id.dataset_name.table_name"
   *
   * The specifcied table must already exist, and the "Cloud ML Service Agent" for your project must
   * have permission to write to it. The table must have the following
   * [schema](/bigquery/docs/schemas):
   *
   *   Field nameType     Mode   modelSTRINGREQUIRED   model_versionSTRINGREQUIRED
   * timeTIMESTAMPREQUIRED   raw_dataSTRINGREQUIRED   raw_predictionSTRINGNULLABLE
   * groundtruthSTRINGNULLABLE
   * @param bigqueryTableName bigqueryTableName or {@code null} for none
   */
  public GoogleCloudMlV1RequestLoggingConfig setBigqueryTableName(java.lang.String bigqueryTableName) {
    this.bigqueryTableName = bigqueryTableName;
    return this;
  }

  /**
   * Percentage of requests to be logged, expressed as a fraction from 0 to 1. For example, if you
   * want to log 10% of requests, enter `0.1`. The sampling window is the lifetime of the model
   * version. Defaults to 0.
   * @return value or {@code null} for none
   */
  public java.lang.Double getSamplingPercentage() {
    return samplingPercentage;
  }

  /**
   * Percentage of requests to be logged, expressed as a fraction from 0 to 1. For example, if you
   * want to log 10% of requests, enter `0.1`. The sampling window is the lifetime of the model
   * version. Defaults to 0.
   * @param samplingPercentage samplingPercentage or {@code null} for none
   */
  public GoogleCloudMlV1RequestLoggingConfig setSamplingPercentage(java.lang.Double samplingPercentage) {
    this.samplingPercentage = samplingPercentage;
    return this;
  }

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

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

}
