<?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.
     *
     * 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.
     *     @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.
     *
     * Generated from protobuf field <code>.google.type.Money cost = 1;</code>
     * @return \Google\Type\Money
     */
    public function getCost()
    {
        return isset($this->cost) ? $this->cost : null;
    }

    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.
     *
     * 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
     */
    public function getDuration()
    {
        return isset($this->duration) ? $this->duration : null;
    }

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

}

