<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/capacityplanner/v1beta/capacity_planning_service.proto

namespace Google\Cloud\CapacityPlanner\V1beta;

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

/**
 * Preference associated with a request, such as flexibility with alternate
 * resource type.
 *
 * Generated from protobuf message <code>google.cloud.capacityplanner.v1beta.DemandPreference</code>
 */
class DemandPreference extends \Google\Protobuf\Internal\Message
{
    /**
     * Output only. The preference id.
     *
     * Generated from protobuf field <code>string preference_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $preference_id = '';
    /**
     * Required. The value of demand preference.
     *
     * Generated from protobuf field <code>.google.cloud.capacityplanner.v1beta.Value value = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $value = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $preference_id
     *           Output only. The preference id.
     *     @type \Google\Cloud\CapacityPlanner\V1beta\Value $value
     *           Required. The value of demand preference.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Capacityplanner\V1Beta\CapacityPlanningService::initOnce();
        parent::__construct($data);
    }

    /**
     * Output only. The preference id.
     *
     * Generated from protobuf field <code>string preference_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return string
     */
    public function getPreferenceId()
    {
        return $this->preference_id;
    }

    /**
     * Output only. The preference id.
     *
     * Generated from protobuf field <code>string preference_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param string $var
     * @return $this
     */
    public function setPreferenceId($var)
    {
        GPBUtil::checkString($var, True);
        $this->preference_id = $var;

        return $this;
    }

    /**
     * Required. The value of demand preference.
     *
     * Generated from protobuf field <code>.google.cloud.capacityplanner.v1beta.Value value = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Cloud\CapacityPlanner\V1beta\Value|null
     */
    public function getValue()
    {
        return $this->value;
    }

    public function hasValue()
    {
        return isset($this->value);
    }

    public function clearValue()
    {
        unset($this->value);
    }

    /**
     * Required. The value of demand preference.
     *
     * Generated from protobuf field <code>.google.cloud.capacityplanner.v1beta.Value value = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Cloud\CapacityPlanner\V1beta\Value $var
     * @return $this
     */
    public function setValue($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\CapacityPlanner\V1beta\Value::class);
        $this->value = $var;

        return $this;
    }

}

