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

namespace Google\Cloud\AIPlatform\V1;

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

/**
 * Request message for [VizierService.CompleteTrial][google.cloud.aiplatform.v1.VizierService.CompleteTrial].
 *
 * Generated from protobuf message <code>google.cloud.aiplatform.v1.CompleteTrialRequest</code>
 */
class CompleteTrialRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The Trial's name.
     * Format:
     * `projects/{project}/locations/{location}/studies/{study}/trials/{trial}`
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     */
    private $name = '';
    /**
     * Optional. If provided, it will be used as the completed Trial's
     * final_measurement; Otherwise, the service will auto-select a
     * previously reported measurement as the final-measurement
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.Measurement final_measurement = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $final_measurement = null;
    /**
     * Optional. True if the Trial cannot be run with the given Parameter, and
     * final_measurement will be ignored.
     *
     * Generated from protobuf field <code>bool trial_infeasible = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $trial_infeasible = false;
    /**
     * Optional. A human readable reason why the trial was infeasible. This should
     * only be provided if `trial_infeasible` is true.
     *
     * Generated from protobuf field <code>string infeasible_reason = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $infeasible_reason = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           Required. The Trial's name.
     *           Format:
     *           `projects/{project}/locations/{location}/studies/{study}/trials/{trial}`
     *     @type \Google\Cloud\AIPlatform\V1\Measurement $final_measurement
     *           Optional. If provided, it will be used as the completed Trial's
     *           final_measurement; Otherwise, the service will auto-select a
     *           previously reported measurement as the final-measurement
     *     @type bool $trial_infeasible
     *           Optional. True if the Trial cannot be run with the given Parameter, and
     *           final_measurement will be ignored.
     *     @type string $infeasible_reason
     *           Optional. A human readable reason why the trial was infeasible. This should
     *           only be provided if `trial_infeasible` is true.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Aiplatform\V1\VizierService::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The Trial's name.
     * Format:
     * `projects/{project}/locations/{location}/studies/{study}/trials/{trial}`
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Required. The Trial's name.
     * Format:
     * `projects/{project}/locations/{location}/studies/{study}/trials/{trial}`
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * Optional. If provided, it will be used as the completed Trial's
     * final_measurement; Otherwise, the service will auto-select a
     * previously reported measurement as the final-measurement
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.Measurement final_measurement = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Cloud\AIPlatform\V1\Measurement|null
     */
    public function getFinalMeasurement()
    {
        return $this->final_measurement;
    }

    public function hasFinalMeasurement()
    {
        return isset($this->final_measurement);
    }

    public function clearFinalMeasurement()
    {
        unset($this->final_measurement);
    }

    /**
     * Optional. If provided, it will be used as the completed Trial's
     * final_measurement; Otherwise, the service will auto-select a
     * previously reported measurement as the final-measurement
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.Measurement final_measurement = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param \Google\Cloud\AIPlatform\V1\Measurement $var
     * @return $this
     */
    public function setFinalMeasurement($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\AIPlatform\V1\Measurement::class);
        $this->final_measurement = $var;

        return $this;
    }

    /**
     * Optional. True if the Trial cannot be run with the given Parameter, and
     * final_measurement will be ignored.
     *
     * Generated from protobuf field <code>bool trial_infeasible = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return bool
     */
    public function getTrialInfeasible()
    {
        return $this->trial_infeasible;
    }

    /**
     * Optional. True if the Trial cannot be run with the given Parameter, and
     * final_measurement will be ignored.
     *
     * Generated from protobuf field <code>bool trial_infeasible = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param bool $var
     * @return $this
     */
    public function setTrialInfeasible($var)
    {
        GPBUtil::checkBool($var);
        $this->trial_infeasible = $var;

        return $this;
    }

    /**
     * Optional. A human readable reason why the trial was infeasible. This should
     * only be provided if `trial_infeasible` is true.
     *
     * Generated from protobuf field <code>string infeasible_reason = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return string
     */
    public function getInfeasibleReason()
    {
        return $this->infeasible_reason;
    }

    /**
     * Optional. A human readable reason why the trial was infeasible. This should
     * only be provided if `trial_infeasible` is true.
     *
     * Generated from protobuf field <code>string infeasible_reason = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param string $var
     * @return $this
     */
    public function setInfeasibleReason($var)
    {
        GPBUtil::checkString($var, True);
        $this->infeasible_reason = $var;

        return $this;
    }

}

