<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/privacy/dlp/v2/dlp.proto

namespace Google\Cloud\Dlp\V2\RecordCondition;

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

/**
 * An expression, consisting or an operator and conditions.
 *
 * Generated from protobuf message <code>google.privacy.dlp.v2.RecordCondition.Expressions</code>
 */
class Expressions extends \Google\Protobuf\Internal\Message
{
    /**
     * The operator to apply to the result of conditions. Default and currently
     * only supported value is `AND`.
     *
     * Generated from protobuf field <code>.google.privacy.dlp.v2.RecordCondition.Expressions.LogicalOperator logical_operator = 1;</code>
     */
    private $logical_operator = 0;
    protected $type;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $logical_operator
     *           The operator to apply to the result of conditions. Default and currently
     *           only supported value is `AND`.
     *     @type \Google\Cloud\Dlp\V2\RecordCondition\Conditions $conditions
     *           Conditions to apply to the expression.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Privacy\Dlp\V2\Dlp::initOnce();
        parent::__construct($data);
    }

    /**
     * The operator to apply to the result of conditions. Default and currently
     * only supported value is `AND`.
     *
     * Generated from protobuf field <code>.google.privacy.dlp.v2.RecordCondition.Expressions.LogicalOperator logical_operator = 1;</code>
     * @return int
     */
    public function getLogicalOperator()
    {
        return $this->logical_operator;
    }

    /**
     * The operator to apply to the result of conditions. Default and currently
     * only supported value is `AND`.
     *
     * Generated from protobuf field <code>.google.privacy.dlp.v2.RecordCondition.Expressions.LogicalOperator logical_operator = 1;</code>
     * @param int $var
     * @return $this
     */
    public function setLogicalOperator($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Dlp\V2\RecordCondition\Expressions\LogicalOperator::class);
        $this->logical_operator = $var;

        return $this;
    }

    /**
     * Conditions to apply to the expression.
     *
     * Generated from protobuf field <code>.google.privacy.dlp.v2.RecordCondition.Conditions conditions = 3;</code>
     * @return \Google\Cloud\Dlp\V2\RecordCondition\Conditions|null
     */
    public function getConditions()
    {
        return $this->readOneof(3);
    }

    public function hasConditions()
    {
        return $this->hasOneof(3);
    }

    /**
     * Conditions to apply to the expression.
     *
     * Generated from protobuf field <code>.google.privacy.dlp.v2.RecordCondition.Conditions conditions = 3;</code>
     * @param \Google\Cloud\Dlp\V2\RecordCondition\Conditions $var
     * @return $this
     */
    public function setConditions($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\RecordCondition\Conditions::class);
        $this->writeOneof(3, $var);

        return $this;
    }

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

}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(Expressions::class, \Google\Cloud\Dlp\V2\RecordCondition_Expressions::class);

