<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/lifesciences/v2beta/workflows.proto

namespace Google\Cloud\LifeSciences\V2beta;

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

/**
 * An event generated when the execution of a pipeline has failed. Note
 * that other events can continue to occur after this event.
 *
 * Generated from protobuf message <code>google.cloud.lifesciences.v2beta.FailedEvent</code>
 */
class FailedEvent extends \Google\Protobuf\Internal\Message
{
    /**
     * The Google standard error code that best describes this failure.
     *
     * Generated from protobuf field <code>.google.rpc.Code code = 1;</code>
     */
    private $code = 0;
    /**
     * The human-readable description of the cause of the failure.
     *
     * Generated from protobuf field <code>string cause = 2;</code>
     */
    private $cause = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $code
     *           The Google standard error code that best describes this failure.
     *     @type string $cause
     *           The human-readable description of the cause of the failure.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Lifesciences\V2Beta\Workflows::initOnce();
        parent::__construct($data);
    }

    /**
     * The Google standard error code that best describes this failure.
     *
     * Generated from protobuf field <code>.google.rpc.Code code = 1;</code>
     * @return int
     */
    public function getCode()
    {
        return $this->code;
    }

    /**
     * The Google standard error code that best describes this failure.
     *
     * 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;
    }

    /**
     * The human-readable description of the cause of the failure.
     *
     * Generated from protobuf field <code>string cause = 2;</code>
     * @return string
     */
    public function getCause()
    {
        return $this->cause;
    }

    /**
     * The human-readable description of the cause of the failure.
     *
     * Generated from protobuf field <code>string cause = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setCause($var)
    {
        GPBUtil::checkString($var, True);
        $this->cause = $var;

        return $this;
    }

}

