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

namespace Google\Cloud\AIPlatform\V1\StudySpec;

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

/**
 * Represents a single parameter to optimize.
 *
 * Generated from protobuf message <code>google.cloud.aiplatform.v1.StudySpec.ParameterSpec</code>
 */
class ParameterSpec extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The ID of the parameter. Must not contain whitespaces and must
     * be unique amongst all ParameterSpecs.
     *
     * Generated from protobuf field <code>string parameter_id = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $parameter_id = '';
    /**
     * How the parameter should be scaled.
     * Leave unset for `CATEGORICAL` parameters.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.StudySpec.ParameterSpec.ScaleType scale_type = 6;</code>
     */
    private $scale_type = 0;
    /**
     * A conditional parameter node is active if the parameter's value matches
     * the conditional node's parent_value_condition.
     * If two items in conditional_parameter_specs have the same name, they
     * must have disjoint parent_value_condition.
     *
     * Generated from protobuf field <code>repeated .google.cloud.aiplatform.v1.StudySpec.ParameterSpec.ConditionalParameterSpec conditional_parameter_specs = 10;</code>
     */
    private $conditional_parameter_specs;
    protected $parameter_value_spec;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\AIPlatform\V1\StudySpec\ParameterSpec\DoubleValueSpec $double_value_spec
     *           The value spec for a 'DOUBLE' parameter.
     *     @type \Google\Cloud\AIPlatform\V1\StudySpec\ParameterSpec\IntegerValueSpec $integer_value_spec
     *           The value spec for an 'INTEGER' parameter.
     *     @type \Google\Cloud\AIPlatform\V1\StudySpec\ParameterSpec\CategoricalValueSpec $categorical_value_spec
     *           The value spec for a 'CATEGORICAL' parameter.
     *     @type \Google\Cloud\AIPlatform\V1\StudySpec\ParameterSpec\DiscreteValueSpec $discrete_value_spec
     *           The value spec for a 'DISCRETE' parameter.
     *     @type string $parameter_id
     *           Required. The ID of the parameter. Must not contain whitespaces and must
     *           be unique amongst all ParameterSpecs.
     *     @type int $scale_type
     *           How the parameter should be scaled.
     *           Leave unset for `CATEGORICAL` parameters.
     *     @type array<\Google\Cloud\AIPlatform\V1\StudySpec\ParameterSpec\ConditionalParameterSpec>|\Google\Protobuf\Internal\RepeatedField $conditional_parameter_specs
     *           A conditional parameter node is active if the parameter's value matches
     *           the conditional node's parent_value_condition.
     *           If two items in conditional_parameter_specs have the same name, they
     *           must have disjoint parent_value_condition.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Aiplatform\V1\Study::initOnce();
        parent::__construct($data);
    }

    /**
     * The value spec for a 'DOUBLE' parameter.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.StudySpec.ParameterSpec.DoubleValueSpec double_value_spec = 2;</code>
     * @return \Google\Cloud\AIPlatform\V1\StudySpec\ParameterSpec\DoubleValueSpec|null
     */
    public function getDoubleValueSpec()
    {
        return $this->readOneof(2);
    }

    public function hasDoubleValueSpec()
    {
        return $this->hasOneof(2);
    }

    /**
     * The value spec for a 'DOUBLE' parameter.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.StudySpec.ParameterSpec.DoubleValueSpec double_value_spec = 2;</code>
     * @param \Google\Cloud\AIPlatform\V1\StudySpec\ParameterSpec\DoubleValueSpec $var
     * @return $this
     */
    public function setDoubleValueSpec($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\AIPlatform\V1\StudySpec\ParameterSpec\DoubleValueSpec::class);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * The value spec for an 'INTEGER' parameter.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.StudySpec.ParameterSpec.IntegerValueSpec integer_value_spec = 3;</code>
     * @return \Google\Cloud\AIPlatform\V1\StudySpec\ParameterSpec\IntegerValueSpec|null
     */
    public function getIntegerValueSpec()
    {
        return $this->readOneof(3);
    }

    public function hasIntegerValueSpec()
    {
        return $this->hasOneof(3);
    }

    /**
     * The value spec for an 'INTEGER' parameter.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.StudySpec.ParameterSpec.IntegerValueSpec integer_value_spec = 3;</code>
     * @param \Google\Cloud\AIPlatform\V1\StudySpec\ParameterSpec\IntegerValueSpec $var
     * @return $this
     */
    public function setIntegerValueSpec($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\AIPlatform\V1\StudySpec\ParameterSpec\IntegerValueSpec::class);
        $this->writeOneof(3, $var);

        return $this;
    }

    /**
     * The value spec for a 'CATEGORICAL' parameter.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.StudySpec.ParameterSpec.CategoricalValueSpec categorical_value_spec = 4;</code>
     * @return \Google\Cloud\AIPlatform\V1\StudySpec\ParameterSpec\CategoricalValueSpec|null
     */
    public function getCategoricalValueSpec()
    {
        return $this->readOneof(4);
    }

    public function hasCategoricalValueSpec()
    {
        return $this->hasOneof(4);
    }

    /**
     * The value spec for a 'CATEGORICAL' parameter.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.StudySpec.ParameterSpec.CategoricalValueSpec categorical_value_spec = 4;</code>
     * @param \Google\Cloud\AIPlatform\V1\StudySpec\ParameterSpec\CategoricalValueSpec $var
     * @return $this
     */
    public function setCategoricalValueSpec($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\AIPlatform\V1\StudySpec\ParameterSpec\CategoricalValueSpec::class);
        $this->writeOneof(4, $var);

        return $this;
    }

    /**
     * The value spec for a 'DISCRETE' parameter.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.StudySpec.ParameterSpec.DiscreteValueSpec discrete_value_spec = 5;</code>
     * @return \Google\Cloud\AIPlatform\V1\StudySpec\ParameterSpec\DiscreteValueSpec|null
     */
    public function getDiscreteValueSpec()
    {
        return $this->readOneof(5);
    }

    public function hasDiscreteValueSpec()
    {
        return $this->hasOneof(5);
    }

    /**
     * The value spec for a 'DISCRETE' parameter.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.StudySpec.ParameterSpec.DiscreteValueSpec discrete_value_spec = 5;</code>
     * @param \Google\Cloud\AIPlatform\V1\StudySpec\ParameterSpec\DiscreteValueSpec $var
     * @return $this
     */
    public function setDiscreteValueSpec($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\AIPlatform\V1\StudySpec\ParameterSpec\DiscreteValueSpec::class);
        $this->writeOneof(5, $var);

        return $this;
    }

    /**
     * Required. The ID of the parameter. Must not contain whitespaces and must
     * be unique amongst all ParameterSpecs.
     *
     * Generated from protobuf field <code>string parameter_id = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getParameterId()
    {
        return $this->parameter_id;
    }

    /**
     * Required. The ID of the parameter. Must not contain whitespaces and must
     * be unique amongst all ParameterSpecs.
     *
     * Generated from protobuf field <code>string parameter_id = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setParameterId($var)
    {
        GPBUtil::checkString($var, True);
        $this->parameter_id = $var;

        return $this;
    }

    /**
     * How the parameter should be scaled.
     * Leave unset for `CATEGORICAL` parameters.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.StudySpec.ParameterSpec.ScaleType scale_type = 6;</code>
     * @return int
     */
    public function getScaleType()
    {
        return $this->scale_type;
    }

    /**
     * How the parameter should be scaled.
     * Leave unset for `CATEGORICAL` parameters.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.StudySpec.ParameterSpec.ScaleType scale_type = 6;</code>
     * @param int $var
     * @return $this
     */
    public function setScaleType($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\AIPlatform\V1\StudySpec\ParameterSpec\ScaleType::class);
        $this->scale_type = $var;

        return $this;
    }

    /**
     * A conditional parameter node is active if the parameter's value matches
     * the conditional node's parent_value_condition.
     * If two items in conditional_parameter_specs have the same name, they
     * must have disjoint parent_value_condition.
     *
     * Generated from protobuf field <code>repeated .google.cloud.aiplatform.v1.StudySpec.ParameterSpec.ConditionalParameterSpec conditional_parameter_specs = 10;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getConditionalParameterSpecs()
    {
        return $this->conditional_parameter_specs;
    }

    /**
     * A conditional parameter node is active if the parameter's value matches
     * the conditional node's parent_value_condition.
     * If two items in conditional_parameter_specs have the same name, they
     * must have disjoint parent_value_condition.
     *
     * Generated from protobuf field <code>repeated .google.cloud.aiplatform.v1.StudySpec.ParameterSpec.ConditionalParameterSpec conditional_parameter_specs = 10;</code>
     * @param array<\Google\Cloud\AIPlatform\V1\StudySpec\ParameterSpec\ConditionalParameterSpec>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setConditionalParameterSpecs($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AIPlatform\V1\StudySpec\ParameterSpec\ConditionalParameterSpec::class);
        $this->conditional_parameter_specs = $arr;

        return $this;
    }

    /**
     * @return string
     */
    public function getParameterValueSpec()
    {
        return $this->whichOneof("parameter_value_spec");
    }

}


