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

namespace Google\Cloud\Workflows\Executions\V1beta\Execution;

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

/**
 * Error describes why the execution was abnormally terminated.
 *
 * Generated from protobuf message <code>google.cloud.workflows.executions.v1beta.Execution.Error</code>
 */
class Error extends \Google\Protobuf\Internal\Message
{
    /**
     * Error payload returned by the execution, represented as a JSON string.
     *
     * Generated from protobuf field <code>string payload = 1;</code>
     */
    private $payload = '';
    /**
     * Human readable error context, helpful for debugging purposes.
     *
     * Generated from protobuf field <code>string context = 2;</code>
     */
    private $context = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $payload
     *           Error payload returned by the execution, represented as a JSON string.
     *     @type string $context
     *           Human readable error context, helpful for debugging purposes.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Workflows\Executions\V1Beta\Executions::initOnce();
        parent::__construct($data);
    }

    /**
     * Error payload returned by the execution, represented as a JSON string.
     *
     * Generated from protobuf field <code>string payload = 1;</code>
     * @return string
     */
    public function getPayload()
    {
        return $this->payload;
    }

    /**
     * Error payload returned by the execution, represented as a JSON string.
     *
     * Generated from protobuf field <code>string payload = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setPayload($var)
    {
        GPBUtil::checkString($var, True);
        $this->payload = $var;

        return $this;
    }

    /**
     * Human readable error context, helpful for debugging purposes.
     *
     * Generated from protobuf field <code>string context = 2;</code>
     * @return string
     */
    public function getContext()
    {
        return $this->context;
    }

    /**
     * Human readable error context, helpful for debugging purposes.
     *
     * Generated from protobuf field <code>string context = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setContext($var)
    {
        GPBUtil::checkString($var, True);
        $this->context = $var;

        return $this;
    }

}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(Error::class, \Google\Cloud\Workflows\Executions\V1beta\Execution_Error::class);

