<?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 the impact a recommendation can have for a given category.
 *
 * Generated from protobuf message <code>google.cloud.recommender.v1.Impact</code>
 */
class Impact extends \Google\Protobuf\Internal\Message
{
    /**
     * Category that is being targeted.
     *
     * Generated from protobuf field <code>.google.cloud.recommender.v1.Impact.Category category = 1;</code>
     */
    private $category = 0;
    protected $projection;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $category
     *           Category that is being targeted.
     *     @type \Google\Cloud\Recommender\V1\CostProjection $cost_projection
     *           Use with CategoryType.COST
     *     @type \Google\Cloud\Recommender\V1\SecurityProjection $security_projection
     *           Use with CategoryType.SECURITY
     *     @type \Google\Cloud\Recommender\V1\SustainabilityProjection $sustainability_projection
     *           Use with CategoryType.SUSTAINABILITY
     *     @type \Google\Cloud\Recommender\V1\ReliabilityProjection $reliability_projection
     *           Use with CategoryType.RELIABILITY
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Recommender\V1\Recommendation::initOnce();
        parent::__construct($data);
    }

    /**
     * Category that is being targeted.
     *
     * Generated from protobuf field <code>.google.cloud.recommender.v1.Impact.Category category = 1;</code>
     * @return int
     */
    public function getCategory()
    {
        return $this->category;
    }

    /**
     * Category that is being targeted.
     *
     * Generated from protobuf field <code>.google.cloud.recommender.v1.Impact.Category category = 1;</code>
     * @param int $var
     * @return $this
     */
    public function setCategory($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Recommender\V1\Impact\Category::class);
        $this->category = $var;

        return $this;
    }

    /**
     * Use with CategoryType.COST
     *
     * Generated from protobuf field <code>.google.cloud.recommender.v1.CostProjection cost_projection = 100;</code>
     * @return \Google\Cloud\Recommender\V1\CostProjection|null
     */
    public function getCostProjection()
    {
        return $this->readOneof(100);
    }

    public function hasCostProjection()
    {
        return $this->hasOneof(100);
    }

    /**
     * Use with CategoryType.COST
     *
     * Generated from protobuf field <code>.google.cloud.recommender.v1.CostProjection cost_projection = 100;</code>
     * @param \Google\Cloud\Recommender\V1\CostProjection $var
     * @return $this
     */
    public function setCostProjection($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Recommender\V1\CostProjection::class);
        $this->writeOneof(100, $var);

        return $this;
    }

    /**
     * Use with CategoryType.SECURITY
     *
     * Generated from protobuf field <code>.google.cloud.recommender.v1.SecurityProjection security_projection = 101;</code>
     * @return \Google\Cloud\Recommender\V1\SecurityProjection|null
     */
    public function getSecurityProjection()
    {
        return $this->readOneof(101);
    }

    public function hasSecurityProjection()
    {
        return $this->hasOneof(101);
    }

    /**
     * Use with CategoryType.SECURITY
     *
     * Generated from protobuf field <code>.google.cloud.recommender.v1.SecurityProjection security_projection = 101;</code>
     * @param \Google\Cloud\Recommender\V1\SecurityProjection $var
     * @return $this
     */
    public function setSecurityProjection($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Recommender\V1\SecurityProjection::class);
        $this->writeOneof(101, $var);

        return $this;
    }

    /**
     * Use with CategoryType.SUSTAINABILITY
     *
     * Generated from protobuf field <code>.google.cloud.recommender.v1.SustainabilityProjection sustainability_projection = 102;</code>
     * @return \Google\Cloud\Recommender\V1\SustainabilityProjection|null
     */
    public function getSustainabilityProjection()
    {
        return $this->readOneof(102);
    }

    public function hasSustainabilityProjection()
    {
        return $this->hasOneof(102);
    }

    /**
     * Use with CategoryType.SUSTAINABILITY
     *
     * Generated from protobuf field <code>.google.cloud.recommender.v1.SustainabilityProjection sustainability_projection = 102;</code>
     * @param \Google\Cloud\Recommender\V1\SustainabilityProjection $var
     * @return $this
     */
    public function setSustainabilityProjection($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Recommender\V1\SustainabilityProjection::class);
        $this->writeOneof(102, $var);

        return $this;
    }

    /**
     * Use with CategoryType.RELIABILITY
     *
     * Generated from protobuf field <code>.google.cloud.recommender.v1.ReliabilityProjection reliability_projection = 103;</code>
     * @return \Google\Cloud\Recommender\V1\ReliabilityProjection|null
     */
    public function getReliabilityProjection()
    {
        return $this->readOneof(103);
    }

    public function hasReliabilityProjection()
    {
        return $this->hasOneof(103);
    }

    /**
     * Use with CategoryType.RELIABILITY
     *
     * Generated from protobuf field <code>.google.cloud.recommender.v1.ReliabilityProjection reliability_projection = 103;</code>
     * @param \Google\Cloud\Recommender\V1\ReliabilityProjection $var
     * @return $this
     */
    public function setReliabilityProjection($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Recommender\V1\ReliabilityProjection::class);
        $this->writeOneof(103, $var);

        return $this;
    }

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

}

