<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# NO CHECKED-IN PROTOBUF GENCODE
# source: temporal/api/history/v1/message.proto

namespace Temporal\Api\History\V1;

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

/**
 * Generated from protobuf message <code>temporal.api.history.v1.ActivityTaskFailedEventAttributes</code>
 */
class ActivityTaskFailedEventAttributes extends \Google\Protobuf\Internal\Message
{
    /**
     * Failure details
     *
     * Generated from protobuf field <code>.temporal.api.failure.v1.Failure failure = 1;</code>
     */
    protected $failure = null;
    /**
     * The id of the `ACTIVITY_TASK_SCHEDULED` event this failure corresponds to
     *
     * Generated from protobuf field <code>int64 scheduled_event_id = 2;</code>
     */
    protected $scheduled_event_id = 0;
    /**
     * The id of the `ACTIVITY_TASK_STARTED` event this failure corresponds to
     *
     * Generated from protobuf field <code>int64 started_event_id = 3;</code>
     */
    protected $started_event_id = 0;
    /**
     * id of the worker that failed this task
     *
     * Generated from protobuf field <code>string identity = 4;</code>
     */
    protected $identity = '';
    /**
     * Generated from protobuf field <code>.temporal.api.enums.v1.RetryState retry_state = 5;</code>
     */
    protected $retry_state = 0;
    /**
     * Version info of the worker who processed this workflow task.
     * Deprecated. This field should be cleaned up when versioning-2 API is removed. [cleanup-experimental-wv]
     *
     * Generated from protobuf field <code>.temporal.api.common.v1.WorkerVersionStamp worker_version = 6 [deprecated = true];</code>
     * @deprecated
     */
    protected $worker_version = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Temporal\Api\Failure\V1\Failure $failure
     *           Failure details
     *     @type int|string $scheduled_event_id
     *           The id of the `ACTIVITY_TASK_SCHEDULED` event this failure corresponds to
     *     @type int|string $started_event_id
     *           The id of the `ACTIVITY_TASK_STARTED` event this failure corresponds to
     *     @type string $identity
     *           id of the worker that failed this task
     *     @type int $retry_state
     *     @type \Temporal\Api\Common\V1\WorkerVersionStamp $worker_version
     *           Version info of the worker who processed this workflow task.
     *           Deprecated. This field should be cleaned up when versioning-2 API is removed. [cleanup-experimental-wv]
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Temporal\Api\History\V1\Message::initOnce();
        parent::__construct($data);
    }

    /**
     * Failure details
     *
     * Generated from protobuf field <code>.temporal.api.failure.v1.Failure failure = 1;</code>
     * @return \Temporal\Api\Failure\V1\Failure|null
     */
    public function getFailure()
    {
        return $this->failure;
    }

    public function hasFailure()
    {
        return isset($this->failure);
    }

    public function clearFailure()
    {
        unset($this->failure);
    }

    /**
     * Failure details
     *
     * Generated from protobuf field <code>.temporal.api.failure.v1.Failure failure = 1;</code>
     * @param \Temporal\Api\Failure\V1\Failure $var
     * @return $this
     */
    public function setFailure($var)
    {
        GPBUtil::checkMessage($var, \Temporal\Api\Failure\V1\Failure::class);
        $this->failure = $var;

        return $this;
    }

    /**
     * The id of the `ACTIVITY_TASK_SCHEDULED` event this failure corresponds to
     *
     * Generated from protobuf field <code>int64 scheduled_event_id = 2;</code>
     * @return int|string
     */
    public function getScheduledEventId()
    {
        return $this->scheduled_event_id;
    }

    /**
     * The id of the `ACTIVITY_TASK_SCHEDULED` event this failure corresponds to
     *
     * Generated from protobuf field <code>int64 scheduled_event_id = 2;</code>
     * @param int|string $var
     * @return $this
     */
    public function setScheduledEventId($var)
    {
        GPBUtil::checkInt64($var);
        $this->scheduled_event_id = $var;

        return $this;
    }

    /**
     * The id of the `ACTIVITY_TASK_STARTED` event this failure corresponds to
     *
     * Generated from protobuf field <code>int64 started_event_id = 3;</code>
     * @return int|string
     */
    public function getStartedEventId()
    {
        return $this->started_event_id;
    }

    /**
     * The id of the `ACTIVITY_TASK_STARTED` event this failure corresponds to
     *
     * Generated from protobuf field <code>int64 started_event_id = 3;</code>
     * @param int|string $var
     * @return $this
     */
    public function setStartedEventId($var)
    {
        GPBUtil::checkInt64($var);
        $this->started_event_id = $var;

        return $this;
    }

    /**
     * id of the worker that failed this task
     *
     * Generated from protobuf field <code>string identity = 4;</code>
     * @return string
     */
    public function getIdentity()
    {
        return $this->identity;
    }

    /**
     * id of the worker that failed this task
     *
     * Generated from protobuf field <code>string identity = 4;</code>
     * @param string $var
     * @return $this
     */
    public function setIdentity($var)
    {
        GPBUtil::checkString($var, True);
        $this->identity = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>.temporal.api.enums.v1.RetryState retry_state = 5;</code>
     * @return int
     */
    public function getRetryState()
    {
        return $this->retry_state;
    }

    /**
     * Generated from protobuf field <code>.temporal.api.enums.v1.RetryState retry_state = 5;</code>
     * @param int $var
     * @return $this
     */
    public function setRetryState($var)
    {
        GPBUtil::checkEnum($var, \Temporal\Api\Enums\V1\RetryState::class);
        $this->retry_state = $var;

        return $this;
    }

    /**
     * Version info of the worker who processed this workflow task.
     * Deprecated. This field should be cleaned up when versioning-2 API is removed. [cleanup-experimental-wv]
     *
     * Generated from protobuf field <code>.temporal.api.common.v1.WorkerVersionStamp worker_version = 6 [deprecated = true];</code>
     * @return \Temporal\Api\Common\V1\WorkerVersionStamp|null
     * @deprecated
     */
    public function getWorkerVersion()
    {
        if (isset($this->worker_version)) {
            @trigger_error('worker_version is deprecated.', E_USER_DEPRECATED);
        }
        return $this->worker_version;
    }

    public function hasWorkerVersion()
    {
        if (isset($this->worker_version)) {
            @trigger_error('worker_version is deprecated.', E_USER_DEPRECATED);
        }
        return isset($this->worker_version);
    }

    public function clearWorkerVersion()
    {
        @trigger_error('worker_version is deprecated.', E_USER_DEPRECATED);
        unset($this->worker_version);
    }

    /**
     * Version info of the worker who processed this workflow task.
     * Deprecated. This field should be cleaned up when versioning-2 API is removed. [cleanup-experimental-wv]
     *
     * Generated from protobuf field <code>.temporal.api.common.v1.WorkerVersionStamp worker_version = 6 [deprecated = true];</code>
     * @param \Temporal\Api\Common\V1\WorkerVersionStamp $var
     * @return $this
     * @deprecated
     */
    public function setWorkerVersion($var)
    {
        @trigger_error('worker_version is deprecated.', E_USER_DEPRECATED);
        GPBUtil::checkMessage($var, \Temporal\Api\Common\V1\WorkerVersionStamp::class);
        $this->worker_version = $var;

        return $this;
    }

}

