<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/aiplatform/v1/endpoint.proto

namespace Google\Cloud\AIPlatform\V1;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;

/**
 * Configuration for logging request-response to a BigQuery table.
 *
 * Generated from protobuf message <code>google.cloud.aiplatform.v1.PredictRequestResponseLoggingConfig</code>
 */
class PredictRequestResponseLoggingConfig extends \Google\Protobuf\Internal\Message
{
    /**
     * If logging is enabled or not.
     *
     * Generated from protobuf field <code>bool enabled = 1;</code>
     */
    private $enabled = false;
    /**
     * Percentage of requests to be logged, expressed as a fraction in
     * range(0,1].
     *
     * Generated from protobuf field <code>double sampling_rate = 2;</code>
     */
    private $sampling_rate = 0.0;
    /**
     * BigQuery table for logging.
     * If only given a project, a new dataset will be created with name
     * `logging_<endpoint-display-name>_<endpoint-id>` where
     * <endpoint-display-name> will be made BigQuery-dataset-name compatible (e.g.
     * most special characters will become underscores). If no table name is
     * given, a new table will be created with name `request_response_logging`
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.BigQueryDestination bigquery_destination = 3;</code>
     */
    private $bigquery_destination = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type bool $enabled
     *           If logging is enabled or not.
     *     @type float $sampling_rate
     *           Percentage of requests to be logged, expressed as a fraction in
     *           range(0,1].
     *     @type \Google\Cloud\AIPlatform\V1\BigQueryDestination $bigquery_destination
     *           BigQuery table for logging.
     *           If only given a project, a new dataset will be created with name
     *           `logging_<endpoint-display-name>_<endpoint-id>` where
     *           <endpoint-display-name> will be made BigQuery-dataset-name compatible (e.g.
     *           most special characters will become underscores). If no table name is
     *           given, a new table will be created with name `request_response_logging`
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Aiplatform\V1\Endpoint::initOnce();
        parent::__construct($data);
    }

    /**
     * If logging is enabled or not.
     *
     * Generated from protobuf field <code>bool enabled = 1;</code>
     * @return bool
     */
    public function getEnabled()
    {
        return $this->enabled;
    }

    /**
     * If logging is enabled or not.
     *
     * Generated from protobuf field <code>bool enabled = 1;</code>
     * @param bool $var
     * @return $this
     */
    public function setEnabled($var)
    {
        GPBUtil::checkBool($var);
        $this->enabled = $var;

        return $this;
    }

    /**
     * Percentage of requests to be logged, expressed as a fraction in
     * range(0,1].
     *
     * Generated from protobuf field <code>double sampling_rate = 2;</code>
     * @return float
     */
    public function getSamplingRate()
    {
        return $this->sampling_rate;
    }

    /**
     * Percentage of requests to be logged, expressed as a fraction in
     * range(0,1].
     *
     * Generated from protobuf field <code>double sampling_rate = 2;</code>
     * @param float $var
     * @return $this
     */
    public function setSamplingRate($var)
    {
        GPBUtil::checkDouble($var);
        $this->sampling_rate = $var;

        return $this;
    }

    /**
     * BigQuery table for logging.
     * If only given a project, a new dataset will be created with name
     * `logging_<endpoint-display-name>_<endpoint-id>` where
     * <endpoint-display-name> will be made BigQuery-dataset-name compatible (e.g.
     * most special characters will become underscores). If no table name is
     * given, a new table will be created with name `request_response_logging`
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.BigQueryDestination bigquery_destination = 3;</code>
     * @return \Google\Cloud\AIPlatform\V1\BigQueryDestination|null
     */
    public function getBigqueryDestination()
    {
        return $this->bigquery_destination;
    }

    public function hasBigqueryDestination()
    {
        return isset($this->bigquery_destination);
    }

    public function clearBigqueryDestination()
    {
        unset($this->bigquery_destination);
    }

    /**
     * BigQuery table for logging.
     * If only given a project, a new dataset will be created with name
     * `logging_<endpoint-display-name>_<endpoint-id>` where
     * <endpoint-display-name> will be made BigQuery-dataset-name compatible (e.g.
     * most special characters will become underscores). If no table name is
     * given, a new table will be created with name `request_response_logging`
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.BigQueryDestination bigquery_destination = 3;</code>
     * @param \Google\Cloud\AIPlatform\V1\BigQueryDestination $var
     * @return $this
     */
    public function setBigqueryDestination($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\AIPlatform\V1\BigQueryDestination::class);
        $this->bigquery_destination = $var;

        return $this;
    }

}

