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

namespace Google\Cloud\Ces\V1\TransferRule;

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

/**
 * Deterministic transfer rule. When the condition evaluates to true, the
 * transfer occurs.
 *
 * Generated from protobuf message <code>google.cloud.ces.v1.TransferRule.DeterministicTransfer</code>
 */
class DeterministicTransfer extends \Google\Protobuf\Internal\Message
{
    protected $condition_type;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\Ces\V1\ExpressionCondition $expression_condition
     *           Optional. A rule that evaluates a session state condition.
     *           If the condition evaluates to true, the transfer occurs.
     *     @type \Google\Cloud\Ces\V1\PythonCodeCondition $python_code_condition
     *           Optional. A rule that uses Python code block to evaluate the
     *           conditions. If the condition evaluates to true, the transfer occurs.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Ces\V1\AgentTransfers::initOnce();
        parent::__construct($data);
    }

    /**
     * Optional. A rule that evaluates a session state condition.
     * If the condition evaluates to true, the transfer occurs.
     *
     * Generated from protobuf field <code>.google.cloud.ces.v1.ExpressionCondition expression_condition = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Cloud\Ces\V1\ExpressionCondition|null
     */
    public function getExpressionCondition()
    {
        return $this->readOneof(1);
    }

    public function hasExpressionCondition()
    {
        return $this->hasOneof(1);
    }

    /**
     * Optional. A rule that evaluates a session state condition.
     * If the condition evaluates to true, the transfer occurs.
     *
     * Generated from protobuf field <code>.google.cloud.ces.v1.ExpressionCondition expression_condition = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param \Google\Cloud\Ces\V1\ExpressionCondition $var
     * @return $this
     */
    public function setExpressionCondition($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Ces\V1\ExpressionCondition::class);
        $this->writeOneof(1, $var);

        return $this;
    }

    /**
     * Optional. A rule that uses Python code block to evaluate the
     * conditions. If the condition evaluates to true, the transfer occurs.
     *
     * Generated from protobuf field <code>.google.cloud.ces.v1.PythonCodeCondition python_code_condition = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Cloud\Ces\V1\PythonCodeCondition|null
     */
    public function getPythonCodeCondition()
    {
        return $this->readOneof(2);
    }

    public function hasPythonCodeCondition()
    {
        return $this->hasOneof(2);
    }

    /**
     * Optional. A rule that uses Python code block to evaluate the
     * conditions. If the condition evaluates to true, the transfer occurs.
     *
     * Generated from protobuf field <code>.google.cloud.ces.v1.PythonCodeCondition python_code_condition = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param \Google\Cloud\Ces\V1\PythonCodeCondition $var
     * @return $this
     */
    public function setPythonCodeCondition($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Ces\V1\PythonCodeCondition::class);
        $this->writeOneof(2, $var);

        return $this;
    }

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

}

