<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/policytroubleshooter/iam/v3/troubleshooter.proto

namespace Google\Cloud\PolicyTroubleshooter\Iam\V3;

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

/**
 * Explanation for how a condition affects a principal's access
 *
 * Generated from protobuf message <code>google.cloud.policytroubleshooter.iam.v3.ConditionExplanation</code>
 */
class ConditionExplanation extends \Google\Protobuf\Internal\Message
{
    /**
     * Value of the condition.
     *
     * Generated from protobuf field <code>.google.protobuf.Value value = 1;</code>
     */
    protected $value = null;
    /**
     * Any errors that prevented complete evaluation of the condition expression.
     *
     * Generated from protobuf field <code>repeated .google.rpc.Status errors = 3;</code>
     */
    private $errors;
    /**
     * The value of each statement of the condition expression. The value can be
     * `true`, `false`, or `null`. The value is `null` if the statement can't be
     * evaluated.
     *
     * Generated from protobuf field <code>repeated .google.cloud.policytroubleshooter.iam.v3.ConditionExplanation.EvaluationState evaluation_states = 2;</code>
     */
    private $evaluation_states;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Protobuf\Value $value
     *           Value of the condition.
     *     @type array<\Google\Rpc\Status>|\Google\Protobuf\Internal\RepeatedField $errors
     *           Any errors that prevented complete evaluation of the condition expression.
     *     @type array<\Google\Cloud\PolicyTroubleshooter\Iam\V3\ConditionExplanation\EvaluationState>|\Google\Protobuf\Internal\RepeatedField $evaluation_states
     *           The value of each statement of the condition expression. The value can be
     *           `true`, `false`, or `null`. The value is `null` if the statement can't be
     *           evaluated.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Policytroubleshooter\Iam\V3\Troubleshooter::initOnce();
        parent::__construct($data);
    }

    /**
     * Value of the condition.
     *
     * Generated from protobuf field <code>.google.protobuf.Value value = 1;</code>
     * @return \Google\Protobuf\Value|null
     */
    public function getValue()
    {
        return $this->value;
    }

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

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

    /**
     * Value of the condition.
     *
     * Generated from protobuf field <code>.google.protobuf.Value value = 1;</code>
     * @param \Google\Protobuf\Value $var
     * @return $this
     */
    public function setValue($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Value::class);
        $this->value = $var;

        return $this;
    }

    /**
     * Any errors that prevented complete evaluation of the condition expression.
     *
     * Generated from protobuf field <code>repeated .google.rpc.Status errors = 3;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getErrors()
    {
        return $this->errors;
    }

    /**
     * Any errors that prevented complete evaluation of the condition expression.
     *
     * Generated from protobuf field <code>repeated .google.rpc.Status errors = 3;</code>
     * @param array<\Google\Rpc\Status>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setErrors($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Rpc\Status::class);
        $this->errors = $arr;

        return $this;
    }

    /**
     * The value of each statement of the condition expression. The value can be
     * `true`, `false`, or `null`. The value is `null` if the statement can't be
     * evaluated.
     *
     * Generated from protobuf field <code>repeated .google.cloud.policytroubleshooter.iam.v3.ConditionExplanation.EvaluationState evaluation_states = 2;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getEvaluationStates()
    {
        return $this->evaluation_states;
    }

    /**
     * The value of each statement of the condition expression. The value can be
     * `true`, `false`, or `null`. The value is `null` if the statement can't be
     * evaluated.
     *
     * Generated from protobuf field <code>repeated .google.cloud.policytroubleshooter.iam.v3.ConditionExplanation.EvaluationState evaluation_states = 2;</code>
     * @param array<\Google\Cloud\PolicyTroubleshooter\Iam\V3\ConditionExplanation\EvaluationState>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setEvaluationStates($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PolicyTroubleshooter\Iam\V3\ConditionExplanation\EvaluationState::class);
        $this->evaluation_states = $arr;

        return $this;
    }

}

