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

namespace Google\Cloud\ResourceSettings\V1;

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

/**
 * The data in a setting value.
 *
 * Generated from protobuf message <code>google.cloud.resourcesettings.v1.Value</code>
 */
class Value extends \Google\Protobuf\Internal\Message
{
    protected $value;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type bool $boolean_value
     *           Defines this value as being a boolean value.
     *     @type string $string_value
     *           Defines this value as being a string value.
     *     @type \Google\Cloud\ResourceSettings\V1\Value\StringSet $string_set_value
     *           Defines this value as being a StringSet.
     *     @type \Google\Cloud\ResourceSettings\V1\Value\EnumValue $enum_value
     *           Defines this value as being a Enum.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Resourcesettings\V1\ResourceSettings::initOnce();
        parent::__construct($data);
    }

    /**
     * Defines this value as being a boolean value.
     *
     * Generated from protobuf field <code>bool boolean_value = 1;</code>
     * @return bool
     */
    public function getBooleanValue()
    {
        return $this->readOneof(1);
    }

    public function hasBooleanValue()
    {
        return $this->hasOneof(1);
    }

    /**
     * Defines this value as being a boolean value.
     *
     * Generated from protobuf field <code>bool boolean_value = 1;</code>
     * @param bool $var
     * @return $this
     */
    public function setBooleanValue($var)
    {
        GPBUtil::checkBool($var);
        $this->writeOneof(1, $var);

        return $this;
    }

    /**
     * Defines this value as being a string value.
     *
     * Generated from protobuf field <code>string string_value = 2;</code>
     * @return string
     */
    public function getStringValue()
    {
        return $this->readOneof(2);
    }

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

    /**
     * Defines this value as being a string value.
     *
     * Generated from protobuf field <code>string string_value = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setStringValue($var)
    {
        GPBUtil::checkString($var, True);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * Defines this value as being a StringSet.
     *
     * Generated from protobuf field <code>.google.cloud.resourcesettings.v1.Value.StringSet string_set_value = 3;</code>
     * @return \Google\Cloud\ResourceSettings\V1\Value\StringSet|null
     */
    public function getStringSetValue()
    {
        return $this->readOneof(3);
    }

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

    /**
     * Defines this value as being a StringSet.
     *
     * Generated from protobuf field <code>.google.cloud.resourcesettings.v1.Value.StringSet string_set_value = 3;</code>
     * @param \Google\Cloud\ResourceSettings\V1\Value\StringSet $var
     * @return $this
     */
    public function setStringSetValue($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\ResourceSettings\V1\Value\StringSet::class);
        $this->writeOneof(3, $var);

        return $this;
    }

    /**
     * Defines this value as being a Enum.
     *
     * Generated from protobuf field <code>.google.cloud.resourcesettings.v1.Value.EnumValue enum_value = 4;</code>
     * @return \Google\Cloud\ResourceSettings\V1\Value\EnumValue|null
     */
    public function getEnumValue()
    {
        return $this->readOneof(4);
    }

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

    /**
     * Defines this value as being a Enum.
     *
     * Generated from protobuf field <code>.google.cloud.resourcesettings.v1.Value.EnumValue enum_value = 4;</code>
     * @param \Google\Cloud\ResourceSettings\V1\Value\EnumValue $var
     * @return $this
     */
    public function setEnumValue($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\ResourceSettings\V1\Value\EnumValue::class);
        $this->writeOneof(4, $var);

        return $this;
    }

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

}

