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

namespace Google\Cloud\AIPlatform\V1;

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

/**
 * Specification for a computation based metric.
 *
 * Generated from protobuf message <code>google.cloud.aiplatform.v1.ComputationBasedMetricSpec</code>
 */
class ComputationBasedMetricSpec extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The type of the computation based metric.
     *
     * Generated from protobuf field <code>optional .google.cloud.aiplatform.v1.ComputationBasedMetricSpec.ComputationBasedMetricType type = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $type = null;
    /**
     * Optional. A map of parameters for the metric, e.g. {"rouge_type":
     * "rougeL"}.
     *
     * Generated from protobuf field <code>optional .google.protobuf.Struct parameters = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $parameters = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $type
     *           Required. The type of the computation based metric.
     *     @type \Google\Protobuf\Struct $parameters
     *           Optional. A map of parameters for the metric, e.g. {"rouge_type":
     *           "rougeL"}.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Aiplatform\V1\EvaluationService::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The type of the computation based metric.
     *
     * Generated from protobuf field <code>optional .google.cloud.aiplatform.v1.ComputationBasedMetricSpec.ComputationBasedMetricType type = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return int
     */
    public function getType()
    {
        return isset($this->type) ? $this->type : 0;
    }

    public function hasType()
    {
        return isset($this->type);
    }

    public function clearType()
    {
        unset($this->type);
    }

    /**
     * Required. The type of the computation based metric.
     *
     * Generated from protobuf field <code>optional .google.cloud.aiplatform.v1.ComputationBasedMetricSpec.ComputationBasedMetricType type = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param int $var
     * @return $this
     */
    public function setType($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\AIPlatform\V1\ComputationBasedMetricSpec\ComputationBasedMetricType::class);
        $this->type = $var;

        return $this;
    }

    /**
     * Optional. A map of parameters for the metric, e.g. {"rouge_type":
     * "rougeL"}.
     *
     * Generated from protobuf field <code>optional .google.protobuf.Struct parameters = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Protobuf\Struct|null
     */
    public function getParameters()
    {
        return $this->parameters;
    }

    public function hasParameters()
    {
        return isset($this->parameters);
    }

    public function clearParameters()
    {
        unset($this->parameters);
    }

    /**
     * Optional. A map of parameters for the metric, e.g. {"rouge_type":
     * "rougeL"}.
     *
     * Generated from protobuf field <code>optional .google.protobuf.Struct parameters = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param \Google\Protobuf\Struct $var
     * @return $this
     */
    public function setParameters($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class);
        $this->parameters = $var;

        return $this;
    }

}

