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

namespace Google\Cloud\Recommender\V1;

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

/**
 * Contains metadata about how much money a recommendation can save or incur.
 *
 * Generated from protobuf message <code>google.cloud.recommender.v1.CostProjection</code>
 */
class CostProjection extends \Google\Protobuf\Internal\Message
{
    /**
     * An approximate projection on amount saved or amount incurred. Negative cost
     * units indicate cost savings and positive cost units indicate increase.
     * See google.type.Money documentation for positive/negative units.
     * A user's permissions may affect whether the cost is computed using list
     * prices or custom contract prices.
     *
     * Generated from protobuf field <code>.google.type.Money cost = 1;</code>
     */
    private $cost = null;
    /**
     * Duration for which this cost applies.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration duration = 2;</code>
     */
    private $duration = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Type\Money $cost
     *           An approximate projection on amount saved or amount incurred. Negative cost
     *           units indicate cost savings and positive cost units indicate increase.
     *           See google.type.Money documentation for positive/negative units.
     *           A user's permissions may affect whether the cost is computed using list
     *           prices or custom contract prices.
     *     @type \Google\Protobuf\Duration $duration
     *           Duration for which this cost applies.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Recommender\V1\Recommendation::initOnce();
        parent::__construct($data);
    }

    /**
     * An approximate projection on amount saved or amount incurred. Negative cost
     * units indicate cost savings and positive cost units indicate increase.
     * See google.type.Money documentation for positive/negative units.
     * A user's permissions may affect whether the cost is computed using list
     * prices or custom contract prices.
     *
     * Generated from protobuf field <code>.google.type.Money cost = 1;</code>
     * @return \Google\Type\Money|null
     */
    public function getCost()
    {
        return $this->cost;
    }

    public function hasCost()
    {
        return isset($this->cost);
    }

    public function clearCost()
    {
        unset($this->cost);
    }

    /**
     * An approximate projection on amount saved or amount incurred. Negative cost
     * units indicate cost savings and positive cost units indicate increase.
     * See google.type.Money documentation for positive/negative units.
     * A user's permissions may affect whether the cost is computed using list
     * prices or custom contract prices.
     *
     * Generated from protobuf field <code>.google.type.Money cost = 1;</code>
     * @param \Google\Type\Money $var
     * @return $this
     */
    public function setCost($var)
    {
        GPBUtil::checkMessage($var, \Google\Type\Money::class);
        $this->cost = $var;

        return $this;
    }

    /**
     * Duration for which this cost applies.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration duration = 2;</code>
     * @return \Google\Protobuf\Duration|null
     */
    public function getDuration()
    {
        return $this->duration;
    }

    public function hasDuration()
    {
        return isset($this->duration);
    }

    public function clearDuration()
    {
        unset($this->duration);
    }

    /**
     * Duration for which this cost applies.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration duration = 2;</code>
     * @param \Google\Protobuf\Duration $var
     * @return $this
     */
    public function setDuration($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class);
        $this->duration = $var;

        return $this;
    }

}

