<?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;

/**
 * Metadata about a setting which is not editable by the end user.
 *
 * Generated from protobuf message <code>google.cloud.resourcesettings.v1.SettingMetadata</code>
 */
class SettingMetadata extends \Google\Protobuf\Internal\Message
{
    /**
     * The human readable name for this setting.
     *
     * Generated from protobuf field <code>string display_name = 1;</code>
     */
    private $display_name = '';
    /**
     * A detailed description of what this setting does.
     *
     * Generated from protobuf field <code>string description = 2;</code>
     */
    private $description = '';
    /**
     * A flag indicating that values of this setting cannot be modified (see
     * documentation of the specific setting for updates and reasons).
     *
     * Generated from protobuf field <code>bool read_only = 3;</code>
     */
    private $read_only = false;
    /**
     * The data type for this setting.
     *
     * Generated from protobuf field <code>.google.cloud.resourcesettings.v1.SettingMetadata.DataType data_type = 4;</code>
     */
    private $data_type = 0;
    /**
     * The value provided by [Setting.effective_value][google.cloud.resourcesettings.v1.Setting.effective_value] if no setting value is
     * explicitly set.
     * Note: not all settings have a default value.
     *
     * Generated from protobuf field <code>.google.cloud.resourcesettings.v1.Value default_value = 5;</code>
     */
    private $default_value = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $display_name
     *           The human readable name for this setting.
     *     @type string $description
     *           A detailed description of what this setting does.
     *     @type bool $read_only
     *           A flag indicating that values of this setting cannot be modified (see
     *           documentation of the specific setting for updates and reasons).
     *     @type int $data_type
     *           The data type for this setting.
     *     @type \Google\Cloud\ResourceSettings\V1\Value $default_value
     *           The value provided by [Setting.effective_value][google.cloud.resourcesettings.v1.Setting.effective_value] if no setting value is
     *           explicitly set.
     *           Note: not all settings have a default value.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Resourcesettings\V1\ResourceSettings::initOnce();
        parent::__construct($data);
    }

    /**
     * The human readable name for this setting.
     *
     * Generated from protobuf field <code>string display_name = 1;</code>
     * @return string
     */
    public function getDisplayName()
    {
        return $this->display_name;
    }

    /**
     * The human readable name for this setting.
     *
     * Generated from protobuf field <code>string display_name = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setDisplayName($var)
    {
        GPBUtil::checkString($var, True);
        $this->display_name = $var;

        return $this;
    }

    /**
     * A detailed description of what this setting does.
     *
     * Generated from protobuf field <code>string description = 2;</code>
     * @return string
     */
    public function getDescription()
    {
        return $this->description;
    }

    /**
     * A detailed description of what this setting does.
     *
     * Generated from protobuf field <code>string description = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setDescription($var)
    {
        GPBUtil::checkString($var, True);
        $this->description = $var;

        return $this;
    }

    /**
     * A flag indicating that values of this setting cannot be modified (see
     * documentation of the specific setting for updates and reasons).
     *
     * Generated from protobuf field <code>bool read_only = 3;</code>
     * @return bool
     */
    public function getReadOnly()
    {
        return $this->read_only;
    }

    /**
     * A flag indicating that values of this setting cannot be modified (see
     * documentation of the specific setting for updates and reasons).
     *
     * Generated from protobuf field <code>bool read_only = 3;</code>
     * @param bool $var
     * @return $this
     */
    public function setReadOnly($var)
    {
        GPBUtil::checkBool($var);
        $this->read_only = $var;

        return $this;
    }

    /**
     * The data type for this setting.
     *
     * Generated from protobuf field <code>.google.cloud.resourcesettings.v1.SettingMetadata.DataType data_type = 4;</code>
     * @return int
     */
    public function getDataType()
    {
        return $this->data_type;
    }

    /**
     * The data type for this setting.
     *
     * Generated from protobuf field <code>.google.cloud.resourcesettings.v1.SettingMetadata.DataType data_type = 4;</code>
     * @param int $var
     * @return $this
     */
    public function setDataType($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\ResourceSettings\V1\SettingMetadata\DataType::class);
        $this->data_type = $var;

        return $this;
    }

    /**
     * The value provided by [Setting.effective_value][google.cloud.resourcesettings.v1.Setting.effective_value] if no setting value is
     * explicitly set.
     * Note: not all settings have a default value.
     *
     * Generated from protobuf field <code>.google.cloud.resourcesettings.v1.Value default_value = 5;</code>
     * @return \Google\Cloud\ResourceSettings\V1\Value|null
     */
    public function getDefaultValue()
    {
        return $this->default_value;
    }

    public function hasDefaultValue()
    {
        return isset($this->default_value);
    }

    public function clearDefaultValue()
    {
        unset($this->default_value);
    }

    /**
     * The value provided by [Setting.effective_value][google.cloud.resourcesettings.v1.Setting.effective_value] if no setting value is
     * explicitly set.
     * Note: not all settings have a default value.
     *
     * Generated from protobuf field <code>.google.cloud.resourcesettings.v1.Value default_value = 5;</code>
     * @param \Google\Cloud\ResourceSettings\V1\Value $var
     * @return $this
     */
    public function setDefaultValue($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\ResourceSettings\V1\Value::class);
        $this->default_value = $var;

        return $this;
    }

}

