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

namespace Google\Cloud\Eventarc\V1;

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

/**
 * A condition that is part of the trigger state computation.
 *
 * Generated from protobuf message <code>google.cloud.eventarc.v1.StateCondition</code>
 */
class StateCondition extends \Google\Protobuf\Internal\Message
{
    /**
     * The canonical code of the condition.
     *
     * Generated from protobuf field <code>.google.rpc.Code code = 1;</code>
     */
    private $code = 0;
    /**
     * Human-readable message.
     *
     * Generated from protobuf field <code>string message = 2;</code>
     */
    private $message = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $code
     *           The canonical code of the condition.
     *     @type string $message
     *           Human-readable message.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Eventarc\V1\Trigger::initOnce();
        parent::__construct($data);
    }

    /**
     * The canonical code of the condition.
     *
     * Generated from protobuf field <code>.google.rpc.Code code = 1;</code>
     * @return int
     */
    public function getCode()
    {
        return $this->code;
    }

    /**
     * The canonical code of the condition.
     *
     * Generated from protobuf field <code>.google.rpc.Code code = 1;</code>
     * @param int $var
     * @return $this
     */
    public function setCode($var)
    {
        GPBUtil::checkEnum($var, \Google\Rpc\Code::class);
        $this->code = $var;

        return $this;
    }

    /**
     * Human-readable message.
     *
     * Generated from protobuf field <code>string message = 2;</code>
     * @return string
     */
    public function getMessage()
    {
        return $this->message;
    }

    /**
     * Human-readable message.
     *
     * Generated from protobuf field <code>string message = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setMessage($var)
    {
        GPBUtil::checkString($var, True);
        $this->message = $var;

        return $this;
    }

}

